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

feat(tooltip+popover): add boundary config option

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/tmorehouse/tmorehouse/tooltip into v4-dev Dec 08, 2017
  • Overview 0
  • Commits 17
  • Pipelines 0
  • Changes 3

Created by: tmorehouse

Related to issue #24251 (closed), larger popovers and tooltips which have the trigger element placed inside an element with overflow: scroll (or similar) will end up with weird placements that cover the trigger element (note the trigger button is completely hidden by the popover):

image

This PR, similar to PR #24976, adds a boundary config option, that allows the user to specify what element constrains the positioning of the tooltip or popover. The boundary option accepts a string - either 'scrollParent' (the Popper.js default), 'viewport' or 'window' - or a reference to an HTMLElement (which can only be set via the JavaScript option, not data-boundary="..."). The new config option boundary is passed directly to the Popper.js config modifiers.preventOverflow.boundariesElement as is.

Popover with boundary set to 'viewport', which now can properly breakout of the scrollable parent:

image

This PR doesn't include the position: static fix required in PR #24976 (dropdowns), as tooltips and popover are typically appended to <body> and not the scrollable container, nor is there an obvious parent element to place position: static on.

/cc @Johann-S

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/tmorehouse/tmorehouse/tooltip