mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(popper): fix popper tabindex error (#472)
- Move tabindex attr from trigger to popper
This commit is contained in:
parent
fc23a4ec04
commit
4454c75d63
@ -164,7 +164,7 @@ describe('Popper.vue', () => {
|
||||
const wrapper = _mount({
|
||||
appendToBody: false,
|
||||
})
|
||||
expect(wrapper.find(`.${TEST_TRIGGER}`).attributes('tabindex')).toBe('0')
|
||||
expect(wrapper.find(`.el-popper`).attributes('tabindex')).toBe('0')
|
||||
})
|
||||
|
||||
test('should initialize a new popper when component mounted', async () => {
|
||||
|
@ -82,6 +82,7 @@ export default defineComponent({
|
||||
onMouseLeave: onPopperMouseLeave,
|
||||
onAfterEnter,
|
||||
onAfterLeave,
|
||||
tabindex: tabIndex,
|
||||
visibility,
|
||||
},
|
||||
[
|
||||
@ -99,7 +100,6 @@ export default defineComponent({
|
||||
ariaDescribedby: popperId,
|
||||
class: kls,
|
||||
ref: 'triggerRef',
|
||||
tabindex: tabIndex,
|
||||
...this.events,
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ interface IRenderPopperProps {
|
||||
popperId: string
|
||||
popperRef?: Ref<HTMLElement>
|
||||
pure: boolean
|
||||
tabindex: number
|
||||
visibility: boolean
|
||||
onMouseEnter: () => void
|
||||
onMouseLeave: () => void
|
||||
@ -32,6 +33,7 @@ export default function renderPopper(
|
||||
popperRef,
|
||||
pure,
|
||||
popperId,
|
||||
tabindex,
|
||||
visibility,
|
||||
onMouseEnter,
|
||||
onMouseLeave,
|
||||
@ -71,6 +73,7 @@ export default function renderPopper(
|
||||
id: popperId,
|
||||
ref: popperRef ?? 'popperRef',
|
||||
role: 'tooltip',
|
||||
tabindex,
|
||||
onMouseEnter,
|
||||
onMouseLeave,
|
||||
onClick: stop,
|
||||
@ -87,6 +90,7 @@ export default function renderPopper(
|
||||
'onMouseup',
|
||||
'onClick',
|
||||
'id',
|
||||
'tabindex',
|
||||
],
|
||||
),
|
||||
[[vShow, visibility]],
|
||||
|
Loading…
Reference in New Issue
Block a user