mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 01:11:25 +08:00
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
This commit is contained in:
parent
9fef09333f
commit
006cc3dc24
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user