From 020f3c729a0a05c86abe7e444e9f84b17c095f11 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 3 Aug 2017 09:31:01 -0700 Subject: [PATCH] Fix username typeahead in Remarkup with German keyboard layout Summary: Ref T10252. The previous fix rPa8a9fddb0738 only works for macOS. Under Windows the @ symbol is composed of AltGr+q. For Chrome and Edge the "AltGr" keypressEvent is like pressing the Control key and the Alt key at the same time. This fix changes the condition in such a way, that this case (pressing Control and Alt at the same time) is not blocked. Test Plan: Testing for the issue: - Launch Windows 10, Select German Keyboard, Use latest Chrome (60) - Observe typing `@` does not trigger typeahead - Apply patch, retest, see typeahead. Regression tested: - Windows 10, Chrome, Firefox, Edge - Mac OS, Chrome, Firefox, Safari - Keyboard layouts, English, French, German, Spanish All tests passed Reviewers: benwick, epriestley Reviewed By: epriestley Subscribers: epriestley Maniphest Tasks: T10252 Differential Revision: https://secure.phabricator.com/D18269 --- resources/celerity/map.php | 16 ++++++++-------- webroot/rsrc/js/phuix/PHUIXAutocomplete.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 2437a1e4c2..fb3fd8d64a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -528,7 +528,7 @@ return array( 'rsrc/js/phui/behavior-phui-tab-group.js' => '0a0b10e9', 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionView.js' => '442efd08', - 'rsrc/js/phuix/PHUIXAutocomplete.js' => 'f6699267', + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '4b7430ab', 'rsrc/js/phuix/PHUIXButtonView.js' => 'a37126bd', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8018ee50', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', @@ -881,7 +881,7 @@ return array( 'phui-workpanel-view-css' => 'a3a63478', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => '442efd08', - 'phuix-autocomplete' => 'f6699267', + 'phuix-autocomplete' => '4b7430ab', 'phuix-button-view' => 'a37126bd', 'phuix-dropdown-menu' => '8018ee50', 'phuix-form-control-view' => '83e03671', @@ -1237,6 +1237,12 @@ return array( 'javelin-util', 'phabricator-shaped-request', ), + '4b7430ab' => array( + 'javelin-install', + 'javelin-dom', + 'phuix-icon-view', + 'phabricator-prefab', + ), '4c193c96' => array( 'javelin-behavior', 'javelin-uri', @@ -2127,12 +2133,6 @@ return array( 'javelin-util', 'javelin-reactor', ), - 'f6699267' => array( - 'javelin-install', - 'javelin-dom', - 'phuix-icon-view', - 'phabricator-prefab', - ), 'f7fc67ec' => array( 'javelin-install', 'javelin-typeahead', diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js index ac073a0e38..df4a031377 100644 --- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js +++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js @@ -199,7 +199,7 @@ JX.install('PHUIXAutocomplete', { // to press Alt to type characters like "@" on a German keyboard layout. // The cost of misfiring autocompleters is very small since we do not // eat the keystroke. See T10252. - if (r.metaKey || r.ctrlKey) { + if (r.metaKey || (r.ctrlKey && !r.altKey)) { return; }