fix(components): [tour] focusout error (#15970)

This commit is contained in:
赵添 2024-02-27 15:08:54 +08:00 committed by GitHub
parent 705c999f5f
commit 9785ad1cd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,7 @@
focus-start-el="container"
:focus-trap-el="contentRef || undefined"
@release-requested="onCloseRequested"
@focusout-prevented="onFocusoutPrevented"
>
<slot />
</el-focus-trap>
@ -68,4 +69,10 @@ const { ns } = inject(tourKey)!
const onCloseRequested = () => {
emit('close')
}
const onFocusoutPrevented = (event: CustomEvent) => {
if (event.detail.focusReason === 'pointer') {
event.preventDefault()
}
}
</script>