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
  • !32843

Remove custom `fallbackPlacements` from the dropdown

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge rohit/main/dropdown-fallback-placements into main Jan 19, 2021
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: rohit2sharma95

Closes #32648 (closed)

Why to remove fallbackPlacements option from the dropdown:

  1. This restricts the flipping behavior of the dropdown to four directions only and it does not let the dropdown flip in the exact opposite side of the current placement.
  2. I believe that there should be an option in the dropdown's configuration to override the customized (by bootstrap) configuration of the popper. It is not available for fallbackPlacements right now.

Why to keep fallbackPlacements option in Tooltip/Popover:

Because it provides better placements to Tooltip/Popover IMO (Since there is no official special handing for the placement of Tooltip/Popover on the edges, like- dropstart and dropend for dropdowns). Popper's default value for fallbackPlacements is [oppositePlacement] it means:

If the popper has placement set to bottom, but there isn't enough space to position the popper in that direction, it will change the popper placement to top (opposite side). As soon as enough space is detected on the bottom, the placement will be reverted to the bottom side. But if the top placement doesn't fit (while Popper trying to flip the element), it reverts back to the original placement (to the bottom side even if there was not enough space in the viewport that made Popper try to flip the element). And this behavior causes the issue: #32384 (closed).

More in the description of #32437. So its better to have more fallback placements by default for Tooltip/Popover.


And the flip modifier can be added with fallbackPlacements by the popperConfig option in case the same issue like #32384 (closed) is caused with dropdowns as well (Which is rare in case of dropdowns IMO).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rohit/main/dropdown-fallback-placements