mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 16:44:17 +02:00
Popover/Tooltip: Fix vertical alignment on arrow of tip elements (#35527)
Regression of #32692 Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -449,6 +449,16 @@ class Tooltip extends BaseComponent {
|
|||||||
options: {
|
options: {
|
||||||
element: `.${this.constructor.NAME}-arrow`
|
element: `.${this.constructor.NAME}-arrow`
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'preSetPlacement',
|
||||||
|
enabled: true,
|
||||||
|
phase: 'beforeMain',
|
||||||
|
fn: data => {
|
||||||
|
// Pre-set Popper's placement attribute in order to read the arrow sizes properly.
|
||||||
|
// Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
|
||||||
|
this._getTipElement().setAttribute('data-popper-placement', data.state.placement)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -624,7 +634,6 @@ class Tooltip extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
||||||
static jQueryInterface(config) {
|
static jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
const data = Tooltip.getOrCreateInstance(this, config)
|
const data = Tooltip.getOrCreateInstance(this, config)
|
||||||
|
Reference in New Issue
Block a user