diff --git a/packages/core/src/client/webcomponents/components/floating/FloatingPopover.ts b/packages/core/src/client/webcomponents/components/floating/FloatingPopover.ts index f7bb4c6c..97021cf3 100644 --- a/packages/core/src/client/webcomponents/components/floating/FloatingPopover.ts +++ b/packages/core/src/client/webcomponents/components/floating/FloatingPopover.ts @@ -1,6 +1,6 @@ import type { PropType, VNode } from 'vue' import type { FloatingPopoverProps } from '../../state/floating-tooltip' -import { onClickOutside, useDebounceFn } from '@vueuse/core' +import { onClickOutside, useDebounceFn, useEventListener } from '@vueuse/core' import { defineComponent, h, ref, useTemplateRef, watch } from 'vue' // @unocss-include @@ -26,6 +26,11 @@ const FloatingPopoverComponent = defineComponent({ const el = ref(props.item?.el) const renderCounter = ref(0) + useEventListener(window, 'resize', () => { + if (el.value) + renderCounter.value++ + }) + const clearThrottled = useDebounceFn(() => { if (props.item?.el == null) el.value = undefined