Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !32437

Tooltip/popover - change the default value for `fallbackPlacements`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge rohit/main/fallbackPlacements-option into main Dec 11, 2020
  • Overview 1
  • Commits 4
  • Pipelines 0
  • Changes 4

Created by: rohit2sharma95

The default value for fallbackPlacements has been changed already in #32405 and here are the remaining things to do.

What this PR does:

  • Remove null from fallbackPlacements types
  • Change the default value for fallbackPlacements
  • Update docs for the tooltip/popover

Why to remove null from fallbackPlacements types and keep array:

  • The default value was previously (in v4) 'flip' that can be achieved by passing the single value in the array, like — [oppositePlacement]. Keeping null also sets the fallbackPlacements to [oppositePlacement] (Default value in Popper)
  • It's better to have clockwise (['top', 'right', 'bottom', 'left']) fallback options so that tooltip/popover can be placed to another side even if the opposite placement doesn't fit.

BTW #32384 (closed) is caused because the default value for fallbackPlacements is [oppositePlacement] in Popper and if you check the issue on a bit larger screen, it is not reproduced.

As per Popper's documentation:

If the fallback placement doesn't fit, it reverts back to the original placement.


Not enough space on right (That's why did not flip) Enough space on right (Flipped) After setting clockwise fallback placements in #32405

All SS are from v5.0.0-beta1

This PR probably completes the third todo of #32354 (closed): Update docs after #32405

Preview: https://deploy-preview-32437--twbs-bootstrap.netlify.app/docs/5.0/components/popovers/#example

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rohit/main/fallbackPlacements-option