]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
docs: fix the default value of Popper's `boundary` option (#33685)
authorRohit Sharma <rohit2sharma95@gmail.com>
Wed, 21 Apr 2021 05:15:22 +0000 (10:45 +0530)
committerGitHub <noreply@github.com>
Wed, 21 Apr 2021 05:15:22 +0000 (08:15 +0300)
`'scrollParent'` is no longer the default `boundary` value

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
site/content/docs/5.0/components/tooltips.md

index b56766dd5b84eda72035d51a158aa4e42a7fcf24..61c6753a43e6ab7fab51d197ca5237d0dcf50e47 100644 (file)
@@ -116,12 +116,12 @@ var tooltip = new bootstrap.Tooltip(exampleEl, options)
 {{< callout warning >}}
 ##### Overflow `auto` and `scroll`
 
-Tooltip position attempts to automatically change when a parent container has `overflow: auto` or `overflow: scroll` like our `.table-responsive`, but still keeps the original placement's positioning. To resolve, set the `boundary` option to anything other than default value, `'scrollParent'`, such as `'window'`:
+Tooltip position attempts to automatically change when a **parent container** has `overflow: auto` or `overflow: scroll` like our `.table-responsive`, but still keeps the original placement's positioning. To resolve this, set the [`boundary` option](https://popper.js.org/docs/v2/modifiers/flip/#boundary) (for the flip modifier using the `popperConfig` option) to any HTMLElement to override the default value, `'clippingParents'`, such as `document.body`:
 
 ```js
 var exampleEl = document.getElementById('example')
 var tooltip = new bootstrap.Tooltip(exampleEl, {
-  boundary: 'window'
+  boundary: document.body // or document.querySelector('#boundary')
 })
 ```
 {{< /callout >}}