From dfeefec1f0eb4d64ab3e0421afce5a7b0fca18fd Mon Sep 17 00:00:00 2001 From: David Lynch Date: Tue, 5 Jul 2016 11:24:04 -0500 Subject: [PATCH] TitleOptionWidget: don't subvert OptionWidget's tabindex 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 --- .../src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js b/resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js index 84533aa957..37e6e1afa2 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js @@ -51,6 +51,11 @@ 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) -- 2.20.1