1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Fix middle-click, CTRL+click, right-click etc. on Typehead search results

Summary:
Fix middle-click, CTRL+click, right-click etc. on Typehead search results.

Closes T15149

Test Plan:
Try the following actions on various typeheads:

- right-click
- middle-click
- CTRL+click
- normal click

Demonstration video (2M) showing After patch (on localhost) and Before patch (here on we.phorge.it), where I middle-click and normal-click on menu entries:

{F256610}

Notes:

- the middle click now works (opening in new tab)
- the CTRL+click (or "command" key + click) now works (opening in new tab)
- the right click now opens the context menu (previously broken)
- the normal click should just click (as usual)

Try on:

- search results while typing in main search bar
- search results when editing a Task Tags / assigned to, etc.
- try to click on other weird places
- $$$

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15149

Differential Revision: https://we.phorge.it/D25069
This commit is contained in:
Valerio Bozzolan 2023-03-03 12:12:01 +01:00
parent 36dba82224
commit 53c31b7b13
2 changed files with 21 additions and 10 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => '0e3cf785',
'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => 'f538846d',
'core.pkg.js' => '256dfd7b',
'core.pkg.js' => '6a2c22c2',
'dark-console.pkg.js' => '187792c2',
'differential.pkg.css' => '609e63d4',
'differential.pkg.js' => 'c60bec1b',
@ -265,7 +265,7 @@ return array(
'rsrc/externals/javelin/lib/__tests__/behavior.js' => '8426ebeb',
'rsrc/externals/javelin/lib/behavior.js' => '1b6acc2a',
'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '89a1ae3a',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'a4356cde',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'd96e47a4',
'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'a241536a',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '22ee68a5',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '23387297',
@ -731,7 +731,7 @@ return array(
'javelin-sound' => 'd4cc2d2a',
'javelin-stratcom' => '0889b835',
'javelin-tokenizer' => '89a1ae3a',
'javelin-typeahead' => 'a4356cde',
'javelin-typeahead' => 'd96e47a4',
'javelin-typeahead-composite-source' => '22ee68a5',
'javelin-typeahead-normalizer' => 'a241536a',
'javelin-typeahead-ondemand-source' => '23387297',
@ -1800,12 +1800,6 @@ return array(
'javelin-workflow',
'phabricator-draggable-list',
),
'a4356cde' => array(
'javelin-install',
'javelin-dom',
'javelin-vector',
'javelin-util',
),
'a43ae2ae' => array(
'javelin-install',
'javelin-dom',
@ -2100,6 +2094,12 @@ return array(
'javelin-util',
'phabricator-shaped-request',
),
'd96e47a4' => array(
'javelin-install',
'javelin-dom',
'javelin-vector',
'javelin-util',
),
'da15d3dc' => array(
'phui-oi-list-view-css',
),

View file

@ -84,8 +84,19 @@ JX.install('Typeahead', {
'mousedown',
'tag:a',
JX.bind(this, function(e) {
if (!e.isRightButton()) {
if (e.isNormalMouseEvent()) {
this._choose(e.getNode('tag:a'));
} else {
// fix the middle-click and any non-normal mouse event
// in order to have an "open in a new tab" that just works natively
// or any other browser action that is supposed to be there.
//
// Probably this is one of the specific cases where kill() has
// sense instead of just stop(), since there are not much chances
// that another event listener had anything else to do
// during non-normal mousedown/click events.
// https://we.phorge.it/T15149
e.kill();
}
}));