mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-21 04:15:36 +00:00
58c078437d
When there are just two modes, using arrow keys to switch between them is not intuitive. The focus moving from the selector to the body widget afterwards is even less intuitive. Override default TabOptionWidget to allow options to be highlightable (not just immediately selectable), and mark the current mode's tab as disabled instead of selected (but make it look selected). This results in intuitive keyboard interactions (tabbing to the widget highlights the other tab rather than the current one, pressing enter switches to it). Bug: T274423 Change-Id: I9d358d5f301cbf081380ef5d34ccc8c4e146652e
13 lines
326 B
JavaScript
13 lines
326 B
JavaScript
function ModeTabOptionWidget() {
|
|
// Parent constructor
|
|
ModeTabOptionWidget.super.apply( this, arguments );
|
|
|
|
this.$element.addClass( 'ext-discussiontools-ui-modeTab' );
|
|
}
|
|
|
|
OO.inheritClass( ModeTabOptionWidget, OO.ui.TabOptionWidget );
|
|
|
|
ModeTabOptionWidget.static.highlightable = true;
|
|
|
|
module.exports = ModeTabOptionWidget;
|