diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 00959be9cf..db8912ccf6 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -507,7 +507,7 @@ return array( 'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836', 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262', - 'rsrc/js/phuix/PHUIXAutocomplete.js' => '2b735afc', + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '3d6e37cc', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', 'rsrc/js/phuix/PHUIXFormControl.js' => '8fba1997', 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', @@ -836,7 +836,7 @@ return array( 'phui-workpanel-view-css' => 'adec7699', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => '8cf6d262', - 'phuix-autocomplete' => '2b735afc', + 'phuix-autocomplete' => '3d6e37cc', 'phuix-dropdown-menu' => 'bd4c8dca', 'phuix-form-control-view' => '8fba1997', 'phuix-icon-view' => 'bff6884b', @@ -1023,12 +1023,6 @@ return array( 'javelin-install', 'javelin-util', ), - '2b735afc' => array( - 'javelin-install', - 'javelin-dom', - 'phuix-icon-view', - 'phabricator-prefab', - ), '2b8de964' => array( 'javelin-install', 'javelin-util', @@ -1086,6 +1080,12 @@ return array( 'javelin-util', 'javelin-uri', ), + '3d6e37cc' => array( + 'javelin-install', + 'javelin-dom', + 'phuix-icon-view', + 'phabricator-prefab', + ), '3ee3408b' => array( 'javelin-behavior', 'javelin-behavior-device', diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js index 67e8b4a32a..118ae7e293 100644 --- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js +++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js @@ -55,19 +55,13 @@ JX.install('PHUIXAutocomplete', { JX.bind(this, this._update)); var select = JX.bind(this, this._onselect); - JX.DOM.listen(this._getNode(), 'click', 'typeahead-result', select); + JX.DOM.listen(this._getNode(), 'mousedown', 'typeahead-result', select); var device = JX.bind(this, this._ondevice); JX.Stratcom.listen('phabricator-device-change', null, device); - // When the user clicks away from the textarea, deactivate. However, we - // don't want to deactivate if we're blurring because they clicked an - // option in the dropdown, so put a timeout on the deactivation. This - // will let the click run first if they did actually click a result. - var deactivate = JX.bind(this, function() { - setTimeout(JX.bind(this, this._deactivate), 10); - }); - + // When the user clicks away from the textarea, deactivate. + var deactivate = JX.bind(this, this._deactivate); JX.DOM.listen(area, 'blur', null, deactivate); },