Skip to content

Commit b021da7

Browse files
author
epriestley
committedMay 14, 2020
When users click headers to select diff UI elements, don't eat the events
Summary: Ref T13513. Currently, clicking inline or changeset headers eats the click events. This doesn't serve any clear purpose, and means these clicks do not clear text selections from the document, which is unusual. Test Plan: - Selected some text in a diff. - Clicked a changeset header to select it. - Before patch: text selection and context menu were retained. - After patch: text selection was cleared and context menu was dismissed. Maniphest Tasks: T13513 Differential Revision: https://secure.phabricator.com/D21255
1 parent 42f1a95 commit b021da7

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed
 

‎resources/celerity/map.php

+23-23
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'core.pkg.js' => '845355f4',
1414
'dark-console.pkg.js' => '187792c2',
1515
'differential.pkg.css' => 'b042ee8b',
16-
'differential.pkg.js' => '5d560bda',
16+
'differential.pkg.js' => 'e0600220',
1717
'diffusion.pkg.css' => '42c75c37',
1818
'diffusion.pkg.js' => 'a98c0bf7',
1919
'maniphest.pkg.css' => '35995d6d',
@@ -379,8 +379,8 @@
379379
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be',
380380
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9',
381381
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
382-
'rsrc/js/application/diff/DiffChangeset.js' => 'b6bb0240',
383-
'rsrc/js/application/diff/DiffChangesetList.js' => '1e8658bb',
382+
'rsrc/js/application/diff/DiffChangeset.js' => 'd721533b',
383+
'rsrc/js/application/diff/DiffChangesetList.js' => '8b0eab21',
384384
'rsrc/js/application/diff/DiffInline.js' => '734d3c33',
385385
'rsrc/js/application/diff/DiffPathView.js' => '8207abf9',
386386
'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b',
@@ -774,8 +774,8 @@
774774
'phabricator-darklog' => '3b869402',
775775
'phabricator-darkmessage' => '26cd4b73',
776776
'phabricator-dashboard-css' => '5a205b9d',
777-
'phabricator-diff-changeset' => 'b6bb0240',
778-
'phabricator-diff-changeset-list' => '1e8658bb',
777+
'phabricator-diff-changeset' => 'd721533b',
778+
'phabricator-diff-changeset-list' => '8b0eab21',
779779
'phabricator-diff-inline' => '734d3c33',
780780
'phabricator-diff-path-view' => '8207abf9',
781781
'phabricator-diff-tree-view' => '5d83623b',
@@ -1069,11 +1069,6 @@
10691069
'javelin-behavior',
10701070
'javelin-dom',
10711071
),
1072-
'1e8658bb' => array(
1073-
'javelin-install',
1074-
'phuix-button-view',
1075-
'phabricator-diff-tree-view',
1076-
),
10771072
'1ff278aa' => array(
10781073
'phui-button-css',
10791074
),
@@ -1675,6 +1670,11 @@
16751670
'javelin-dom',
16761671
'phabricator-draggable-list',
16771672
),
1673+
'8b0eab21' => array(
1674+
'javelin-install',
1675+
'phuix-button-view',
1676+
'phabricator-diff-tree-view',
1677+
),
16781678
'8b5c7d65' => array(
16791679
'javelin-behavior',
16801680
'javelin-stratcom',
@@ -1979,19 +1979,6 @@
19791979
'javelin-stratcom',
19801980
'javelin-dom',
19811981
),
1982-
'b6bb0240' => array(
1983-
'javelin-dom',
1984-
'javelin-util',
1985-
'javelin-stratcom',
1986-
'javelin-install',
1987-
'javelin-workflow',
1988-
'javelin-router',
1989-
'javelin-behavior-device',
1990-
'javelin-vector',
1991-
'phabricator-diff-inline',
1992-
'phabricator-diff-path-view',
1993-
'phuix-button-view',
1994-
),
19951982
'b7b73831' => array(
19961983
'javelin-behavior',
19971984
'javelin-dom',
@@ -2103,6 +2090,19 @@
21032090
'd4cc2d2a' => array(
21042091
'javelin-install',
21052092
),
2093+
'd721533b' => array(
2094+
'javelin-dom',
2095+
'javelin-util',
2096+
'javelin-stratcom',
2097+
'javelin-install',
2098+
'javelin-workflow',
2099+
'javelin-router',
2100+
'javelin-behavior-device',
2101+
'javelin-vector',
2102+
'phabricator-diff-inline',
2103+
'phabricator-diff-path-view',
2104+
'phuix-button-view',
2105+
),
21062106
'd8a86cfb' => array(
21072107
'javelin-behavior',
21082108
'javelin-dom',

‎webroot/rsrc/js/application/diff/DiffChangeset.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,10 @@ JX.install('DiffChangeset', {
907907
return;
908908
}
909909

910-
e.prevent();
910+
// NOTE: Don't prevent or kill the event. If the user has text selected,
911+
// clicking a header should clear the selection (and dismiss any inline
912+
// context menu, if one exists) as clicking elsewhere in the document
913+
// normally would.
911914

912915
if (this._isSelected) {
913916
this.getChangesetList().selectChangeset(null);

‎webroot/rsrc/js/application/diff/DiffChangesetList.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,8 @@ JX.install('DiffChangesetList', {
11311131
return;
11321132
}
11331133

1134-
// The user definitely clicked an inline, so we're going to handle the
1135-
// event.
1136-
e.kill();
1134+
// NOTE: Don't kill or prevent the event. In particular, we want this
1135+
// click to clear any text selection as it normally would.
11371136

11381137
this.selectInline(inline);
11391138
},

0 commit comments

Comments
 (0)
Failed to load comments.