Page MenuHomePhabricator

Don't select {F...} text after adding it to textareas
ClosedPublic

Authored by epriestley on Dec 22 2015, 3:51 PM.
Tags
None
Referenced Files
F13224368: D14851.id35901.diff
Sun, May 19, 8:05 AM
F13211590: D14851.diff
Fri, May 17, 5:54 AM
F13211231: D14851.diff
Fri, May 17, 5:35 AM
F13195283: D14851.diff
Sun, May 12, 10:16 PM
F13180274: D14851.diff
Wed, May 8, 10:52 PM
Unknown Object (File)
Sat, May 4, 6:45 PM
Unknown Object (File)
Wed, May 1, 12:06 AM
Unknown Object (File)
Apr 19 2024, 1:41 PM
Subscribers
None

Details

Summary

Fixes T10039. We add text to textareas in two cases:

  • Users clicking assitance buttons in Remarkup text areas.
  • Drag-and-drop file uploads.

In case (1), it makes sense to highlight the text (it shows the user what we inserted, and lets them undo the action easily if it isn't what they wanted).

In case (2), it does not. Users almost never want to delete or edit a file reference. It is slightly nice to have the reference as a visual callout, but I don't think this is a big deal.

Change the behavior so that we highlight only for remarkup buttons, not for drag-and-drop files.

Test Plan
  • Clicked an "isnert quote" button on remarkup assist area, got highlighted example text.
  • Dragged and dropped a file, got text inserted with no highlight.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Don't select {F...} text after adding it to textareas.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.

There's a small behavioral change here: uploading multiple files no longer puts newlines between them. That seems OKish? Maybe we should insert {F...}\n?

Actually, let me just put that old behavior back for now, since it's probably a little better than {F...}{F...}.

webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
17–23

This was also hacking around the old behavior, so it's nice to get rid of it.

  • When uploading a bunch of files, drop them in with lines between them so they look a little nicer.
chad edited edge metadata.
This revision is now accepted and ready to land.Dec 22 2015, 4:20 PM
This revision was automatically updated to reflect the committed changes.