@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+21 -10
+9 -9
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => '0e3cf785', 11 11 'conpherence.pkg.js' => '020aebcf', 12 12 'core.pkg.css' => 'f538846d', 13 - 'core.pkg.js' => '256dfd7b', 13 + 'core.pkg.js' => '6a2c22c2', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '609e63d4', 16 16 'differential.pkg.js' => 'c60bec1b', ··· 265 265 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '8426ebeb', 266 266 'rsrc/externals/javelin/lib/behavior.js' => '1b6acc2a', 267 267 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '89a1ae3a', 268 - 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'a4356cde', 268 + 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'd96e47a4', 269 269 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'a241536a', 270 270 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '22ee68a5', 271 271 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '23387297', ··· 731 731 'javelin-sound' => 'd4cc2d2a', 732 732 'javelin-stratcom' => '0889b835', 733 733 'javelin-tokenizer' => '89a1ae3a', 734 - 'javelin-typeahead' => 'a4356cde', 734 + 'javelin-typeahead' => 'd96e47a4', 735 735 'javelin-typeahead-composite-source' => '22ee68a5', 736 736 'javelin-typeahead-normalizer' => 'a241536a', 737 737 'javelin-typeahead-ondemand-source' => '23387297', ··· 1800 1800 'javelin-workflow', 1801 1801 'phabricator-draggable-list', 1802 1802 ), 1803 - 'a4356cde' => array( 1804 - 'javelin-install', 1805 - 'javelin-dom', 1806 - 'javelin-vector', 1807 - 'javelin-util', 1808 - ), 1809 1803 'a43ae2ae' => array( 1810 1804 'javelin-install', 1811 1805 'javelin-dom', ··· 2099 2093 'javelin-dom', 2100 2094 'javelin-util', 2101 2095 'phabricator-shaped-request', 2096 + ), 2097 + 'd96e47a4' => array( 2098 + 'javelin-install', 2099 + 'javelin-dom', 2100 + 'javelin-vector', 2101 + 'javelin-util', 2102 2102 ), 2103 2103 'da15d3dc' => array( 2104 2104 'phui-oi-list-view-css',
+12 -1
webroot/rsrc/externals/javelin/lib/control/typeahead/Typeahead.js
··· 84 84 'mousedown', 85 85 'tag:a', 86 86 JX.bind(this, function(e) { 87 - if (!e.isRightButton()) { 87 + if (e.isNormalMouseEvent()) { 88 88 this._choose(e.getNode('tag:a')); 89 + } else { 90 + // fix the middle-click and any non-normal mouse event 91 + // in order to have an "open in a new tab" that just works natively 92 + // or any other browser action that is supposed to be there. 93 + // 94 + // Probably this is one of the specific cases where kill() has 95 + // sense instead of just stop(), since there are not much chances 96 + // that another event listener had anything else to do 97 + // during non-normal mousedown/click events. 98 + // https://we.phorge.it/T15149 99 + e.kill(); 89 100 } 90 101 })); 91 102