mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
fix(components): [focus-trap] popper input focus (#8025)
* fix(components): [focus-trap] fix reclaim focus for paused layer * fix(components): [focus-trap] remove async
This commit is contained in:
parent
60cd22b890
commit
6359538a45
@ -172,7 +172,12 @@ export default defineComponent({
|
||||
const relatedTarget = (e as FocusEvent)
|
||||
.relatedTarget as HTMLElement | null
|
||||
if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
|
||||
tryFocus(lastFocusAfterTrapped, true)
|
||||
// Give embedded focus layer time to pause this layer before reclaiming focus
|
||||
setTimeout(() => {
|
||||
if (!focusLayer.paused) {
|
||||
tryFocus(lastFocusAfterTrapped, true)
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
} else {
|
||||
const target = e.target as HTMLElement | null
|
||||
|
Loading…
Reference in New Issue
Block a user