OptionWidget takes steps to not interfere in the tab order. TitleOptionWidget
uses links as its labels, which has a side-effect of reintroducing a tab-
focusable element into the OptionWidget. Explicitly set tabindex="-1" on these
links, to maintain the OptionWidget behavior.
Bug: T129792
Change-Id: Ia6b1361e7183e253b7abc58037f007936dfa60ff
this.$label.attr( 'href', config.url );
this.$element.addClass( 'mw-widget-titleOptionWidget' );
+ // OOUI OptionWidgets make an effort to not be tab accessible, but
+ // adding a link inside them would undo that. So, explicitly make it
+ // not tabbable.
+ this.$label.attr( 'tabindex', '-1' );
+
// Allow opening the link in new tab, but not regular navigation.
this.$label.on( 'click', function ( e ) {
// Don't interfere with special clicks (e.g. to open in new tab)