mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-22 13:13:03 +02:00
docs: fix the default value of Popper's boundary
option (#33685)
`'scrollParent'` is no longer the default `boundary` value Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -116,12 +116,12 @@ var tooltip = new bootstrap.Tooltip(exampleEl, options)
|
|||||||
{{< callout warning >}}
|
{{< callout warning >}}
|
||||||
##### Overflow `auto` and `scroll`
|
##### 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
|
```js
|
||||||
var exampleEl = document.getElementById('example')
|
var exampleEl = document.getElementById('example')
|
||||||
var tooltip = new bootstrap.Tooltip(exampleEl, {
|
var tooltip = new bootstrap.Tooltip(exampleEl, {
|
||||||
boundary: 'window'
|
boundary: document.body // or document.querySelector('#boundary')
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
{{< /callout >}}
|
{{< /callout >}}
|
||||||
|
Reference in New Issue
Block a user