@@ -20,6 +20,13 @@ ruleTester.run('template-no-noninteractive-tabindex', rule, {
2020 '<template><input tabindex="-1" /></template>' ,
2121 '<template><select tabindex="0"></select></template>' ,
2222
23+ // <audio>/<video> with `controls` render an interactive UI.
24+ '<template><audio controls tabindex="0"></audio></template>' ,
25+ '<template><video controls tabindex="0"></video></template>' ,
26+
27+ // <object> is a widget per axobject-query — allow tabindex.
28+ '<template><object tabindex="0"></object></template>' ,
29+
2330 // Non-interactive element made interactive via role.
2431 '<template><div role="button" tabindex="0"></div></template>' ,
2532 '<template><div role="checkbox" tabindex="0" aria-checked="false"></div></template>' ,
@@ -70,6 +77,17 @@ ruleTester.run('template-no-noninteractive-tabindex', rule, {
7077 output : null ,
7178 errors : [ { messageId : 'noNonInteractiveTabindex' } ] ,
7279 } ,
80+ // <audio>/<video> without `controls` have no interactive UI — still flag.
81+ {
82+ code : '<template><audio tabindex="0"></audio></template>' ,
83+ output : null ,
84+ errors : [ { messageId : 'noNonInteractiveTabindex' } ] ,
85+ } ,
86+ {
87+ code : '<template><video tabindex="0"></video></template>' ,
88+ output : null ,
89+ errors : [ { messageId : 'noNonInteractiveTabindex' } ] ,
90+ } ,
7391 ] ,
7492} ) ;
7593
0 commit comments