Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#21656 closed enhancement (fixed)

Focusing on code textareas during setup should select all

Reported by: jblz Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:


Automatically selecting all text in the textarea.code elements on focus reduces the number of steps required to copy the settings to a file and reduces the likelihood of a new user only copying the visible portion at the top.

Attachments (2)

21656.patch (3.7 KB) - added by jblz 8 years ago.
21656.diff (601 bytes) - added by nacin 8 years ago.

Download all attachments as: .zip

Change History (7)

8 years ago

#1 @nacin
8 years ago

  • Milestone changed from Awaiting Review to 3.5

8 years ago

#2 @nacin
8 years ago

Automatically selecting on focus/enter/click can be confusing to users, and also buggy — certain keyboard or mouse events might act in strange ways, which pose problems for both accessibility and for keystrokes done by power users. I broke this a few times, though I may have been doing it wrong.

On network.php, we deliberately show all lines, with no scroll. I do want to adjust setup-config.php, as with scrollbars often being hidden in newer browsers and operating systems, it's definitely possible to only grab the visible portion.

I came up with calling .focus() and .select() on the textarea, and it worked well for me. What do you think?

#3 @nacin
8 years ago

I modified some strings in [21870]. The wp-config ID accidentally landed then.

#4 @jblz
8 years ago

.focus() and .select() works for me. thanks.

#5 @nacin
8 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21873]:

On setup-config step 2, default to focusing on the textarea and selecting its contents. fixes #21656.

Note: See TracTickets for help on using tickets.