mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-30 11:16:12 +08:00
fix(popper): fix popper gets covered by dialog/drawer (#861)
- Make popper's zIndex dynamic in order to allow popper related features in `Dialog/Drawer` to show
This commit is contained in:
parent
9ad78debcf
commit
977767e2e7
@ -1,4 +1,4 @@
|
|||||||
import { computed, ref, reactive, watch } from 'vue'
|
import { computed, ref, reactive, watch, CSSProperties } from 'vue'
|
||||||
import { createPopper } from '@popperjs/core'
|
import { createPopper } from '@popperjs/core'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -41,11 +41,7 @@ export default function(
|
|||||||
|
|
||||||
const isManualMode = () => props.manualMode || props.trigger === 'manual'
|
const isManualMode = () => props.manualMode || props.trigger === 'manual'
|
||||||
|
|
||||||
const popperStyle = computed(() => {
|
const popperStyle = ref<CSSProperties>({ zIndex: PopupManager.nextZIndex() })
|
||||||
return {
|
|
||||||
zIndex: String(PopupManager.nextZIndex()),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const popperOptions = usePopperOptions(props, {
|
const popperOptions = usePopperOptions(props, {
|
||||||
arrow: arrowRef,
|
arrow: arrowRef,
|
||||||
@ -189,6 +185,7 @@ export default function(
|
|||||||
|
|
||||||
function onVisibilityChange(toState: boolean) {
|
function onVisibilityChange(toState: boolean) {
|
||||||
if (toState) {
|
if (toState) {
|
||||||
|
popperStyle.value.zIndex = PopupManager.nextZIndex()
|
||||||
initializePopper()
|
initializePopper()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user