WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#42193 new enhancement

Select text in readonly textarea on focus

Reported by: NomNom99 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9
Component: Options, Meta APIs Keywords: has-patch ux-feedback has-screenshots
Focuses: ui, administration Cc:

Description

https://ibin.co/3dVwFgRPo6d1.png

It would be better if the text is selected when the user clicks (focus) on a read-only textarea, especially when it's meant to be copied, for example in the Network Setup section, a user has to copy-paste in the wp-config.php or the .htaccess file.

Attachments (3)

42193.patch (978 bytes) - added by NomNom99 4 months ago.
Adds feature for selecting entire textarea text on focus
42193.1.patch (1.1 KB) - added by NomNom99 4 months ago.
Adds feature for selecting entire textarea text by Button
42193.2.patch (1.1 KB) - added by NomNom99 4 months ago.
Replaced siblings() with prev()

Download all attachments as: .zip

Change History (7)

@NomNom99
4 months ago

Adds feature for selecting entire textarea text on focus

#1 @swissspidy
4 months ago

  • Component changed from Administration to Networks and Sites
  • Focuses accessibility javascript removed
  • Keywords has-patch ux-feedback added

When you just want to select a specific part of the textarea's content, 42193.patch does not work great.

Another option would be to add a copy button. Just click on it to put the content into the clipboard.

The regular permalinks setup could benefit from such a change as well.

#2 @NomNom99
4 months ago

@swissspidy That makes sense. I'll add a button instead.

@NomNom99
4 months ago

Adds feature for selecting entire textarea text by Button

@NomNom99
4 months ago

Replaced siblings() with prev()

#3 @NomNom99
4 months ago

Render after patch.
https://ibin.co/3ek8ZylmCPd8.png

#4 @swissspidy
4 months ago

  • Component changed from Networks and Sites to Options, Meta APIs
  • Focuses ui added
  • Keywords has-screenshots added
  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.