@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 a flash of document selection when "oncopy" and "inline on range" behaviors interact

Summary:
Ref T13513. In Safari, do this:

- view a 2-up diff with content on both sides;
- select more than one line on the right side; and
- use your mouse to click "New Inline Comment" in the context menu that pops up.

The mousedown event for the "New Inline Comment" click removes the "copy selection" behavior and creates a flash where both sides of the diff are selected.

This doesn't happen with (most) normal clicks because mouse down on a non-grabbable element clears the document selection.

To avoid this, don't reset the copy selection behavior if the user mouses down on an "<a />". This might not be robust, but seems simple and plausible as a fix.

Test Plan:
- See above.
- Before patch: flash of overbroad selection when clicking "New Inline Comment".
- After patch: no selection flash.

Maniphest Tasks: T13513

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

+18 -7
+7 -7
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => '0e3cf785', 11 11 'conpherence.pkg.js' => '020aebcf', 12 12 'core.pkg.css' => 'a560707d', 13 - 'core.pkg.js' => '0efaf0ac', 13 + 'core.pkg.js' => '845355f4', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => 'b042ee8b', 16 16 'differential.pkg.js' => '5d560bda', ··· 488 488 'rsrc/js/core/behavior-linked-container.js' => '74446546', 489 489 'rsrc/js/core/behavior-more.js' => '506aa3f4', 490 490 'rsrc/js/core/behavior-object-selector.js' => '98ef467f', 491 - 'rsrc/js/core/behavior-oncopy.js' => 'b475aae5', 491 + 'rsrc/js/core/behavior-oncopy.js' => 'da8f5259', 492 492 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => '54262396', 493 493 'rsrc/js/core/behavior-read-only-warning.js' => 'b9109f8f', 494 494 'rsrc/js/core/behavior-redirect.js' => '407ee861', ··· 648 648 'javelin-behavior-phabricator-line-linker' => '590e6527', 649 649 'javelin-behavior-phabricator-notification-example' => '29819b75', 650 650 'javelin-behavior-phabricator-object-selector' => '98ef467f', 651 - 'javelin-behavior-phabricator-oncopy' => 'b475aae5', 651 + 'javelin-behavior-phabricator-oncopy' => 'da8f5259', 652 652 'javelin-behavior-phabricator-remarkup-assist' => '54262396', 653 653 'javelin-behavior-phabricator-reveal-content' => 'b105a3a6', 654 654 'javelin-behavior-phabricator-search-typeahead' => '1cb7d027', ··· 1952 1952 'javelin-workboard-card-template', 1953 1953 'javelin-workboard-order-template', 1954 1954 ), 1955 - 'b475aae5' => array( 1956 - 'javelin-behavior', 1957 - 'javelin-dom', 1958 - ), 1959 1955 'b49fd60c' => array( 1960 1956 'multirow-row-manager', 1961 1957 'trigger-rule', ··· 2115 2111 ), 2116 2112 'da15d3dc' => array( 2117 2113 'phui-oi-list-view-css', 2114 + ), 2115 + 'da8f5259' => array( 2116 + 'javelin-behavior', 2117 + 'javelin-dom', 2118 2118 ), 2119 2119 'dae2d55b' => array( 2120 2120 'javelin-behavior',
+11
webroot/rsrc/js/core/behavior-oncopy.js
··· 11 11 function onstartselect(e) { 12 12 var target = e.getTarget(); 13 13 14 + // See T13513. If the user selects multiple lines in a 2-up diff and then 15 + // clicks "New Inline Comment" in the context menu that pops up, the 16 + // mousedown causes us to arrive here and remove the "selectable" CSS 17 + // styles, and creates a flash of selected content across both sides of 18 + // the diff, which is distracting. To attempt to avoid this, bail out if 19 + // the user clicked a link. 20 + 21 + if (JX.DOM.isType(target, 'a')) { 22 + return; 23 + } 24 + 14 25 var container; 15 26 try { 16 27 // NOTE: For now, all elements with custom oncopy behavior are tables,