From 006cc3dc2465aa465103b3ee9c2f2b897f574dc5 Mon Sep 17 00:00:00 2001 From: webfansplz <308241863@qq.com> Date: Wed, 13 Jul 2022 09:50:09 +0800 Subject: [PATCH] fix(components): [focus-trap] maximum call stack size exceeded error (#8218) * fix(components): [focus-trap] add debounce for emit `focusin` event * chore: update * chore: update --- packages/components/popper/src/content.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/popper/src/content.vue b/packages/components/popper/src/content.vue index 10e4ad519f..16cd10e3c5 100644 --- a/packages/components/popper/src/content.vue +++ b/packages/components/popper/src/content.vue @@ -151,13 +151,13 @@ const onFocusAfterReleased = () => { const onFocusInTrap = (event: FocusEvent) => { if (props.visible && !trapped.value) { - if (event.relatedTarget) { - ;(event.relatedTarget as HTMLElement)?.focus() - } if (event.target) { focusStartRef.value = event.target as typeof focusStartRef.value } trapped.value = true + if (event.relatedTarget) { + ;(event.relatedTarget as HTMLElement)?.focus() + } } }