Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/189608

Change subject: MenuSelectWidget: Codify current behavior of Tab closing the 
menu
......................................................................

MenuSelectWidget: Codify current behavior of Tab closing the menu

Currently keyboard navigation of MenuSelectWidget only works when
used with a LookupElement/TextInputWidget. In that combination,
pressing Tab happens to close the menu, because it blurs the input,
which has a event handler to do the closing.

Codify this behavior in MenuSelectWidget itself too, since we need
to do something sensible with the menu when we make DropdownWidget
and such focusable, and the user opens the menu and tabs away. An
alternative to closing is selecting the highlighted option, which
is being discussed at T53229.

Change-Id: I21efc6f847dd09f44f0cb6833da7caca844928f7
---
M src/widgets/MenuSelectWidget.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/08/189608/1

diff --git a/src/widgets/MenuSelectWidget.js b/src/widgets/MenuSelectWidget.js
index 3e1fa84..85fd4cd 100644
--- a/src/widgets/MenuSelectWidget.js
+++ b/src/widgets/MenuSelectWidget.js
@@ -92,11 +92,13 @@
                                handled = true;
                                break;
                        case OO.ui.Keys.ESCAPE:
+                               handled = true;
+                               /* falls through */
+                       case OO.ui.Keys.TAB:
                                if ( highlightItem ) {
                                        highlightItem.setHighlighted( false );
                                }
                                this.toggle( false );
-                               handled = true;
                                break;
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/189608
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21efc6f847dd09f44f0cb6833da7caca844928f7
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to