Page MenuHomePhabricator

Unified diffs don't allow selecting text in inline comments
Closed, ResolvedPublic


The logic in webroot/rsrc/js/application/differential/behavior-user-select.js to make text unselectable makes inline comments unselectable in Unified diff view. In side-by-side view, both inline comments and code are selectable. It is often useful to be able to copy/paste text from other's inline comments.

Phabricator version 067d12d7168a580bce695cb26331df785f86c2e9, in Chrome 53.0.2785.116.

Event Timeline

alexmv created this task.Sep 29 2016, 11:50 PM

With no claim that this is the world's most elegant fix, I think this may be a fix:

diff --git a/webroot/rsrc/css/application/differential/core.css b/webroot/rsrc/css/application/differential/core.css
index 2dcc02b..af7544a 100644
--- a/webroot/rsrc/css/application/differential/core.css
+++ b/webroot/rsrc/css/application/differential/core.css
@@ -16,7 +16,7 @@
   margin-bottom: 8px;
-.differential-unselectable tr td:nth-of-type(1) {
+.differential-unselectable.diff-2up tr td:nth-of-type(1) {
   -moz-user-select: -moz-none;
   -khtml-user-select: none;
   -webkit-user-select: none;
peterwj added a subscriber: peterwj.Oct 4 2016, 5:24 AM
pasik added a subscriber: pasik.May 12 2018, 1:55 PM
epriestley closed this task as Resolved.Feb 20 2019, 2:50 PM
epriestley claimed this task.

D20196 removes this code.