@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.

Hide tooltips on any keypress

Summary:
Fixes T4586, where a keystroke like "return" to submit a form could remove DOM nodes rendering a tooltip, leaving the user with a permanent phantom tooltip.

(@spicyj, if you come up with anything better than this feel free to send a followup, but I //think// this is a reasonable fix.)

A nice side effect of this is that it hides any tooltips obscuring a text input when you start typing.

Test Plan: Hovered over a tooltip, pressed a key, tip vanished.

Reviewers: spicyj, btrahan

Reviewed By: btrahan

Subscribers: aran, spicyj, epriestley

Maniphest Tasks: T4586

Differential Revision: https://secure.phabricator.com/D8497

+25 -21
+15 -15
resources/celerity/map.php
··· 8 8 'names' => 9 9 array( 10 10 'core.pkg.css' => 'c650ab0d', 11 - 'core.pkg.js' => 'b7bdab05', 11 + 'core.pkg.js' => '264721e1', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => 'd1b3a605', 14 14 'differential.pkg.js' => '11a5b750', ··· 474 474 'rsrc/js/core/behavior-select-on-click.js' => '0e34ca02', 475 475 'rsrc/js/core/behavior-toggle-class.js' => 'a82a7769', 476 476 'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884', 477 - 'rsrc/js/core/behavior-tooltip.js' => 'e5dd1c6d', 477 + 'rsrc/js/core/behavior-tooltip.js' => '48db4145', 478 478 'rsrc/js/core/behavior-watch-anchor.js' => '06e05112', 479 479 'rsrc/js/core/behavior-workflow.js' => '82947dda', 480 480 'rsrc/js/core/phtize.js' => 'd254d646', ··· 602 602 'javelin-behavior-phabricator-reveal-content' => '8f24abfc', 603 603 'javelin-behavior-phabricator-search-typeahead' => 'f6b56f7a', 604 604 'javelin-behavior-phabricator-show-all-transactions' => '7c273581', 605 - 'javelin-behavior-phabricator-tooltips' => 'e5dd1c6d', 605 + 'javelin-behavior-phabricator-tooltips' => '48db4145', 606 606 'javelin-behavior-phabricator-transaction-comment-form' => '9084a36f', 607 607 'javelin-behavior-phabricator-transaction-list' => '3c918aa8', 608 608 'javelin-behavior-phabricator-watch-anchor' => '06e05112', ··· 1116 1116 4 => 'javelin-util', 1117 1117 5 => 'phabricator-prefab', 1118 1118 ), 1119 + '48db4145' => 1120 + array( 1121 + 0 => 'javelin-behavior', 1122 + 1 => 'javelin-behavior-device', 1123 + 2 => 'javelin-stratcom', 1124 + 3 => 'phabricator-tooltip', 1125 + ), 1119 1126 '493665ee' => 1120 1127 array( 1121 1128 0 => 'javelin-install', ··· 1229 1236 2 => 'javelin-util', 1230 1237 3 => 'phabricator-shaped-request', 1231 1238 ), 1239 + '7319e029' => 1240 + array( 1241 + 0 => 'javelin-behavior', 1242 + 1 => 'javelin-dom', 1243 + ), 1232 1244 '62e18640' => 1233 1245 array( 1234 1246 0 => 'javelin-install', ··· 1263 1275 0 => 'javelin-behavior', 1264 1276 1 => 'javelin-stratcom', 1265 1277 2 => 'javelin-dom', 1266 - ), 1267 - '7319e029' => 1268 - array( 1269 - 0 => 'javelin-behavior', 1270 - 1 => 'javelin-dom', 1271 1278 ), 1272 1279 '75903ee1' => 1273 1280 array( ··· 1835 1842 1 => 'javelin-dom', 1836 1843 2 => 'javelin-view-visitor', 1837 1844 3 => 'javelin-util', 1838 - ), 1839 - 'e5dd1c6d' => 1840 - array( 1841 - 0 => 'javelin-behavior', 1842 - 1 => 'javelin-behavior-device', 1843 - 2 => 'javelin-stratcom', 1844 - 3 => 'phabricator-tooltip', 1845 1845 ), 1846 1846 'e7c21fb3' => 1847 1847 array(
+10 -6
webroot/rsrc/js/core/behavior-tooltip.js
··· 31 31 data.tip); 32 32 }); 33 33 34 + function wipe(e) { 35 + JX.Tooltip.hide(); 36 + } 37 + 38 + // Hide tips when any key is pressed. This prevents tips from ending up locked 39 + // on screen if you make a keypress which removes the underlying node (for 40 + // example, submitting an inline comment in Differential). See T4586. 41 + JX.Stratcom.listen('keydown', null, wipe); 42 + 34 43 // When we leave the page, hide any visible tooltips. If we don't do this, 35 44 // clicking a link with a tooltip and then hitting "back" will give you a 36 45 // phantom tooltip. 37 - JX.Stratcom.listen( 38 - 'unload', 39 - null, 40 - function(e) { 41 - JX.Tooltip.hide(); 42 - }); 46 + JX.Stratcom.listen('unload', null, wipe); 43 47 44 48 });