1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00

Eat right-click, etc., on autocomplete suggestion menu

Summary:
Ref T10163. If you right-click the suggestion menu, just eat it. I don't think we can really choose a different behavior reasonably, or that users have any reason to do this.

I'm leaving "clicking the header dismisses it", I think that behavior is fine and reasonable.

Test Plan: Control-clicked a suggestion menu, didn't trigger a suggestion.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10163

Differential Revision: https://secure.phabricator.com/D15042
This commit is contained in:
epriestley 2016-01-16 15:36:45 -08:00
parent b7fe07bbd6
commit 7ab970d1a7
2 changed files with 16 additions and 8 deletions

View file

@ -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' => 'fc10c813',
'rsrc/js/phuix/PHUIXAutocomplete.js' => '21dc9144',
'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' => 'fc10c813',
'phuix-autocomplete' => '21dc9144',
'phuix-dropdown-menu' => 'bd4c8dca',
'phuix-form-control-view' => '8fba1997',
'phuix-icon-view' => 'bff6884b',
@ -1004,6 +1004,12 @@ return array(
'javelin-stratcom',
'conpherence-thread-manager',
),
'21dc9144' => array(
'javelin-install',
'javelin-dom',
'phuix-icon-view',
'phabricator-prefab',
),
'2290aeef' => array(
'javelin-install',
'javelin-dom',
@ -2086,12 +2092,6 @@ return array(
'javelin-behavior-device',
'phabricator-keyboard-shortcut',
),
'fc10c813' => array(
'javelin-install',
'javelin-dom',
'phuix-icon-view',
'phabricator-prefab',
),
'fc91ab6c' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -304,6 +304,14 @@ JX.install('PHUIXAutocomplete', {
},
_onselect: function (e) {
if (!e.isNormalMouseEvent()) {
// Eat right clicks, control clicks, etc., on the results. These can
// not do anything meaningful and if we let them through they'll blur
// the field and dismiss the results.
e.kill();
return;
}
var target = e.getNode('typeahead-result');
for (var ii = 0; ii < this._listNodes.length; ii++) {