mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-20 17:54:23 +01:00
Update docs for offset
option
This commit is contained in:
parent
b1bd54955e
commit
e036e604de
@ -901,9 +901,9 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
||||
<td>array | string | function</td>
|
||||
<td><code>[0, 0]</code></td>
|
||||
<td>
|
||||
<p>Offset of the dropdown relative to its target.</p>
|
||||
<p>When a function is used to determine the offset, it is called with an object containing the <code>popper</code> instance, the <code>refecence</code> Element and the <code>placement</code> as its first argument. The function must return an array with two numbers: <code>[<a href="https://popper.js.org/docs/v2/modifiers/offset/#skidding-1">skidding</a>, <a href="https://popper.js.org/docs/v2/modifiers/offset/#distance-1">distance</a>]</code>. The triggering element DOM node is passed as the second argument.</p>
|
||||
<p>For more information refer to Popper.js's <a href="https://popper.js.org/docs/v2/modifiers/offset/#options">offset docs</a>.</p>
|
||||
<p>Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: <code>data-bs-offset="10,20"</code></p>
|
||||
<p>When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: <code>[<a href="https://popper.js.org/docs/v2/modifiers/offset/#skidding-1">skidding</a>, <a href="https://popper.js.org/docs/v2/modifiers/offset/#distance-1">distance</a>]</code>.</p>
|
||||
<p>For more information refer to Popper's <a href="https://popper.js.org/docs/v2/modifiers/offset/#options">offset docs</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -267,6 +267,16 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt
|
||||
<td><code>null</code></td>
|
||||
<td>Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>offset</code></td>
|
||||
<td>array | string | function</td>
|
||||
<td><code>[0, 0]</code></td>
|
||||
<td>
|
||||
<p>Offset of the popover relative to its target. You can pass a string in data attributes with comma separated values like: <code>data-bs-offset="10,20"</code></p>
|
||||
<p>When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: <code>[<a href="https://popper.js.org/docs/v2/modifiers/offset/#skidding-1">skidding</a>, <a href="https://popper.js.org/docs/v2/modifiers/offset/#distance-1">distance</a>]</code>.</p>
|
||||
<p>For more information refer to Popper's <a href="https://popper.js.org/docs/v2/modifiers/offset/#options">offset docs</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>popperConfig</code></td>
|
||||
<td>null | object</td>
|
||||
|
@ -292,6 +292,16 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt
|
||||
<td><code>null</code></td>
|
||||
<td>Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>offset</code></td>
|
||||
<td>array | string | function</td>
|
||||
<td><code>[0, 0]</code></td>
|
||||
<td>
|
||||
<p>Offset of the tooltip relative to its target. You can pass a string in data attributes with comma separated values like: <code>data-bs-offset="10,20"</code></p>
|
||||
<p>When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: <code>[<a href="https://popper.js.org/docs/v2/modifiers/offset/#skidding-1">skidding</a>, <a href="https://popper.js.org/docs/v2/modifiers/offset/#distance-1">distance</a>]</code>.</p>
|
||||
<p>For more information refer to Popper's <a href="https://popper.js.org/docs/v2/modifiers/offset/#options">offset docs</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>popperConfig</code></td>
|
||||
<td>null | object</td>
|
||||
|
@ -20,6 +20,7 @@ toc: true
|
||||
|
||||
### JavaScript
|
||||
|
||||
- Restored `offset` option for Dropdown, Popover and Tooltip plugins.
|
||||
- The default value for the `fallbackPlacements` is changed to `['top', 'right', 'bottom', 'left']` for better placement of popper elements.
|
||||
|
||||
## v5.0.0-beta1
|
||||
|
Loading…
x
Reference in New Issue
Block a user