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:
jeremywu 2020-12-07 00:22:07 +08:00 committed by GitHub
parent 9ad78debcf
commit 977767e2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
@ -41,11 +41,7 @@ export default function(
const isManualMode = () => props.manualMode || props.trigger === 'manual'
const popperStyle = computed(() => {
return {
zIndex: String(PopupManager.nextZIndex()),
}
})
const popperStyle = ref<CSSProperties>({ zIndex: PopupManager.nextZIndex() })
const popperOptions = usePopperOptions(props, {
arrow: arrowRef,
@ -189,6 +185,7 @@ export default function(
function onVisibilityChange(toState: boolean) {
if (toState) {
popperStyle.value.zIndex = PopupManager.nextZIndex()
initializePopper()
}
}