mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
fix(components): [popper] zIndex bug (#7115)
* fix: popper zIndex bug * fix: add shouldUpdateZIndex control ZIndex Co-authored-by: xiaochenchen <xiaochen.chen@igg.com>
This commit is contained in:
parent
971d58d9f4
commit
9f6a32fb28
@ -71,9 +71,9 @@ const createPopperInstance = ({ referenceEl, popperContentEl, arrowEl }) => {
|
||||
return createPopper(referenceEl, popperContentEl, options)
|
||||
}
|
||||
|
||||
const updatePopper = () => {
|
||||
const updatePopper = (shouldUpdateZIndex = true) => {
|
||||
unref(popperInstanceRef)?.update()
|
||||
contentZIndex.value = props.zIndex || contentZIndex.value || nextZIndex()
|
||||
shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex())
|
||||
}
|
||||
|
||||
const togglePopperAlive = () => {
|
||||
@ -82,7 +82,7 @@ const togglePopperAlive = () => {
|
||||
...options,
|
||||
modifiers: [...(options.modifiers || []), monitorable],
|
||||
}))
|
||||
updatePopper()
|
||||
updatePopper(false)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user