From: David Lynch Date: Tue, 5 Jul 2016 16:24:04 +0000 (-0500) Subject: TitleOptionWidget: don't subvert OptionWidget's tabindex X-Git-Tag: 1.31.0-rc.0~6456 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=dfeefec1f0eb4d64ab3e0421afce5a7b0fca18fd;p=lhc%2Fweb%2Fwiklou.git 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 --- 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)