mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(components): [dropdown] fix A11y when tooltip show (#8655)
This commit is contained in:
parent
468c3a3274
commit
7f3000aa26
@ -24,8 +24,9 @@
|
||||
teleported
|
||||
pure
|
||||
persistent
|
||||
@before-show="handleShowTooltip"
|
||||
@before-hide="handleHideTooltip"
|
||||
@before-show="handleBeforeShowTooltip"
|
||||
@show="handleShowTooltip"
|
||||
@before-hide="handleBeforeHideTooltip"
|
||||
>
|
||||
<template #content>
|
||||
<el-scrollbar
|
||||
@ -191,13 +192,17 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function handleBeforeShowTooltip() {
|
||||
emit('visible-change', true)
|
||||
}
|
||||
|
||||
function handleShowTooltip(event?: Event) {
|
||||
if (event?.type === 'keydown') {
|
||||
contentRef.value.focus()
|
||||
}
|
||||
emit('visible-change', true)
|
||||
}
|
||||
function handleHideTooltip() {
|
||||
|
||||
function handleBeforeHideTooltip() {
|
||||
emit('visible-change', false)
|
||||
}
|
||||
|
||||
@ -245,8 +250,9 @@ export default defineComponent({
|
||||
handleEntryFocus,
|
||||
handleClose,
|
||||
handleOpen,
|
||||
handleBeforeShowTooltip,
|
||||
handleShowTooltip,
|
||||
handleHideTooltip,
|
||||
handleBeforeHideTooltip,
|
||||
onFocusAfterTrapped,
|
||||
popperRef,
|
||||
contentRef,
|
||||
|
Loading…
Reference in New Issue
Block a user