mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-30 02:08:12 +08:00
fix(components): [tooltip] change ariaHidden value after closed the dropdown (#18207)
* fix(components): [tooltip] change ariaHidden value after closed dropdown closed #17720 * test: fix test
This commit is contained in:
parent
c4f7e27bdd
commit
7017d19260
@ -1296,6 +1296,7 @@ describe('DatePicker keyboard events', () => {
|
||||
await input.trigger('keydown', {
|
||||
code: EVENT_CODE.enter,
|
||||
})
|
||||
await rAF()
|
||||
const popperEl2 = document.querySelectorAll('.el-picker__popper')[0]
|
||||
const attr2 = popperEl2.getAttribute('aria-hidden')
|
||||
expect(attr2).toEqual('true')
|
||||
@ -1321,6 +1322,7 @@ describe('DatePicker keyboard events', () => {
|
||||
await input.trigger('keydown', {
|
||||
code: EVENT_CODE.numpadEnter,
|
||||
})
|
||||
await rAF()
|
||||
const popperEl2 = document.querySelectorAll('.el-picker__popper')[0]
|
||||
const attr2 = popperEl2.getAttribute('aria-hidden')
|
||||
expect(attr2).toEqual('true')
|
||||
|
@ -363,8 +363,6 @@ describe('TimePicker', () => {
|
||||
})
|
||||
|
||||
it('ref handleClose', async () => {
|
||||
vi.useFakeTimers()
|
||||
|
||||
const value = ref(new Date(2016, 9, 10, 18, 40))
|
||||
const wrapper = mount(() => <TimePicker v-model={value.value} />)
|
||||
const timePickerExposed = wrapper.findComponent(TimePicker).vm.$.exposed
|
||||
@ -374,12 +372,10 @@ describe('TimePicker', () => {
|
||||
await nextTick()
|
||||
timePickerExposed.handleClose()
|
||||
|
||||
await nextTick()
|
||||
await rAF()
|
||||
const popperEl = document.querySelector('.el-picker__popper')
|
||||
const attr = popperEl.getAttribute('aria-hidden')
|
||||
expect(attr).toEqual('true')
|
||||
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('model value should sync when disabled-hours was updated', async () => {
|
||||
|
@ -106,10 +106,11 @@ const appendTo = computed(() => {
|
||||
|
||||
const contentStyle = computed(() => (props.style ?? {}) as any)
|
||||
|
||||
const ariaHidden = computed(() => !unref(open))
|
||||
const ariaHidden = ref(true)
|
||||
|
||||
const onTransitionLeave = () => {
|
||||
onHide()
|
||||
ariaHidden.value = true
|
||||
}
|
||||
|
||||
const stopWhenControlled = () => {
|
||||
@ -164,6 +165,8 @@ watch(
|
||||
(val) => {
|
||||
if (!val) {
|
||||
stopHandle?.()
|
||||
} else {
|
||||
ariaHidden.value = false
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user