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
Unknown Object (File)
Thu, Dec 26, 3:33 PM
Unknown Object (File)
Tue, Dec 17, 3:55 PM
Unknown Object (File)
Fri, Dec 13, 12:32 PM
Unknown Object (File)
Sat, Nov 30, 1:05 AM
Unknown Object (File)
Thu, Nov 28, 2:30 AM
Unknown Object (File)
Nov 20 2024, 2:42 PM
Unknown Object (File)
Nov 16 2024, 12:47 PM
Unknown Object (File)
Nov 11 2024, 11:14 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.