mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 08:34:08 +02:00
tooltip+popover: add boundary config option (#24979)
This commit is contained in:
@@ -264,6 +264,12 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>Allow to specify which position Popper will use on fallback. For more information refer to
|
<td>Allow to specify which position Popper will use on fallback. For more information refer to
|
||||||
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
|
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>boundary</td>
|
||||||
|
<td>string | element</td>
|
||||||
|
<td>'scrollParent'</td>
|
||||||
|
<td>Overflow constraint boundary of the popover. Accepts the values of <code>'viewport'</code>, <code>'window'</code>, <code>'scrollParent'</code>, or an HTMLElement reference (JavaScript only). For more information refer to Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..preventOverflow.boundariesElement">preventOverflow docs</a>.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -244,6 +244,12 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>Allow to specify which position Popper will use on fallback. For more information refer to
|
<td>Allow to specify which position Popper will use on fallback. For more information refer to
|
||||||
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
|
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>boundary</td>
|
||||||
|
<td>string | element</td>
|
||||||
|
<td>'scrollParent'</td>
|
||||||
|
<td>Overflow constraint boundary of the tooltip. Accepts the values of <code>'viewport'</code>, <code>'window'</code>, <code>'scrollParent'</code>, or an HTMLElement reference (JavaScript only). For more information refer to Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..preventOverflow.boundariesElement">preventOverflow docs</a>.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -38,7 +38,8 @@ const Tooltip = (($) => {
|
|||||||
placement : '(string|function)',
|
placement : '(string|function)',
|
||||||
offset : '(number|string)',
|
offset : '(number|string)',
|
||||||
container : '(string|element|boolean)',
|
container : '(string|element|boolean)',
|
||||||
fallbackPlacement : '(string|array)'
|
fallbackPlacement : '(string|array)',
|
||||||
|
boundary : '(string|element)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const AttachmentMap = {
|
const AttachmentMap = {
|
||||||
@@ -62,7 +63,8 @@ const Tooltip = (($) => {
|
|||||||
placement : 'top',
|
placement : 'top',
|
||||||
offset : 0,
|
offset : 0,
|
||||||
container : false,
|
container : false,
|
||||||
fallbackPlacement : 'flip'
|
fallbackPlacement : 'flip',
|
||||||
|
boundary : 'scrollParent'
|
||||||
}
|
}
|
||||||
|
|
||||||
const HoverState = {
|
const HoverState = {
|
||||||
@@ -301,6 +303,9 @@ const Tooltip = (($) => {
|
|||||||
},
|
},
|
||||||
arrow: {
|
arrow: {
|
||||||
element: Selector.ARROW
|
element: Selector.ARROW
|
||||||
|
},
|
||||||
|
preventOverflow: {
|
||||||
|
boundariesElement: this.config.boundary
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCreate: (data) => {
|
onCreate: (data) => {
|
||||||
|
Reference in New Issue
Block a user