File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ export default {
110
110
this . referenceElm = this . $el ;
111
111
if ( this . $el . nodeType === 1 ) {
112
112
this . $el . setAttribute ( 'aria-describedby' , this . tooltipId ) ;
113
- this . $el . setAttribute ( 'tabindex' , 0 ) ;
113
+ this . $el . setAttribute ( 'tabindex' , this . tabindex ) ;
114
114
on ( this . referenceElm , 'mouseenter' , this . show ) ;
115
115
on ( this . referenceElm , 'mouseleave' , this . hide ) ;
116
116
on ( this . referenceElm , 'focus' , ( ) => {
Original file line number Diff line number Diff line change @@ -153,4 +153,12 @@ describe('Tooltip', () => {
153
153
} , 100 ) ;
154
154
} ) ;
155
155
} ) ;
156
+ it ( 'custom tabindex' , ( ) => {
157
+ vm = createVue ( `
158
+ <el-tooltip ref="tooltip" content="提示文字" :tabindex="-1">
159
+ <button>click</button>
160
+ </el-tooltip>
161
+ ` , true ) ;
162
+ expect ( vm . $el . getAttribute ( 'tabindex' ) ) . to . be . equal ( '-1' ) ;
163
+ } ) ;
156
164
} ) ;
You can’t perform that action at this time.
0 commit comments