diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -528,7 +528,7 @@ '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' => '623a766b', + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '7fa5c915', 'rsrc/js/phuix/PHUIXButtonView.js' => '8a91e1ac', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '04b2ae03', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', @@ -881,7 +881,7 @@ 'phui-workpanel-view-css' => 'a3a63478', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => '442efd08', - 'phuix-autocomplete' => '623a766b', + 'phuix-autocomplete' => '7fa5c915', 'phuix-button-view' => '8a91e1ac', 'phuix-dropdown-menu' => '04b2ae03', 'phuix-form-control-view' => '16ad6224', @@ -1407,12 +1407,6 @@ 'javelin-magical-init', 'javelin-util', ), - '623a766b' => array( - 'javelin-install', - 'javelin-dom', - 'phuix-icon-view', - 'phabricator-prefab', - ), '628f59de' => array( 'phui-oi-list-view-css', ), @@ -1563,6 +1557,12 @@ '7f243deb' => array( 'javelin-install', ), + '7fa5c915' => array( + 'javelin-install', + 'javelin-dom', + 'phuix-icon-view', + 'phabricator-prefab', + ), '81144dfa' => array( 'javelin-behavior', 'javelin-behavior-device', diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js --- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js +++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js @@ -521,6 +521,18 @@ return; } + // Deactivate immediately if a user types a character that we are + // reasonably sure means they don't want to use the autocomplete. For + // example, "##" is almost certainly a header or monospaced text, not + // a project autocompletion. + var cancels = this._getCancelCharacters(); + for (var ii = 0; ii < cancels.length; ii++) { + if (text.indexOf(cancels[ii]) !== -1) { + this._deactivate(); + return; + } + } + var trim = this._trim(text); // If this rule has a prefix pattern, like the "[[ document ]]" rule, @@ -541,18 +553,6 @@ // This needs to match what we pass to the typeahead datasource. this._value = trim; - // Deactivate immediately if a user types a character that we are - // reasonably sure means they don't want to use the autocomplete. For - // example, "##" is almost certainly a header or monospaced text, not - // a project autocompletion. - var cancels = this._getCancelCharacters(); - for (var ii = 0; ii < cancels.length; ii++) { - if (trim.indexOf(cancels[ii]) !== -1) { - this._deactivate(); - return; - } - } - // Deactivate immediately if the user types an ignored token like ":)", // the smiley face emoticon. Note that we test against "text", not // "trim", because the ignore list and suffix list can otherwise