Page MenuHomePhabricator

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

Description

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

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;
epriestley claimed this task.

D20196 removes this code.