Commit c27788f9 authored by Simona's avatar Simona Committed by hetech

Tooltip: fix custom tabindex not work (#15619)

parent 8933a057
......@@ -110,7 +110,7 @@ export default {
this.referenceElm = this.$el;
if (this.$el.nodeType === 1) {
this.$el.setAttribute('aria-describedby', this.tooltipId);
this.$el.setAttribute('tabindex', 0);
this.$el.setAttribute('tabindex', this.tabindex);
on(this.referenceElm, 'mouseenter', this.show);
on(this.referenceElm, 'mouseleave', this.hide);
on(this.referenceElm, 'focus', () => {
......
......@@ -153,4 +153,12 @@ describe('Tooltip', () => {
}, 100);
});
});
it('custom tabindex', () => {
vm = createVue(`
<el-tooltip ref="tooltip" content="提示文字" :tabindex="-1">
<button>click</button>
</el-tooltip>
`, true);
expect(vm.$el.getAttribute('tabindex')).to.be.equal('-1');
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment