emulatetab icon indicating copy to clipboard operation
emulatetab copied to clipboard

Inconsistency if field text will be selected on field focus

Open joelpurra opened this issue 10 years ago • 2 comments

This issue is based on PlusAsTab issue #5 Tab emulation doesn't cause text to be pre-selected / highlighted, reported by @bkwdesign.


According to chapter 7.4.2 Focus management of the W3C HTML5 specification, selecting the text in a field is platform specific and optional.

Note: For example, some platforms select the contents of a text field when that field is focused.

Running tests on my laptop (Mac OS X 10.9 Mavericks, without a numpad) in the enter-as-tab demo.

On page load [autofocus] behavior

  • Chrome 35: Text is selected.
  • Firefox 27: Text is not selected, cursor at position 0.
  • Safari 7: Text is selected.

Normal tabbing

No cursor movement

  • Chrome 35: Field text is selected, except in <textarea> fields.
  • Firefox 27: Field text is selected, except in <textarea> fields.
  • Safari 7: Field text is selected, except in <textarea> fields.

Text selected or cursor moved, unfocus, refocus

  • Chrome 35: All field text selected.
  • Firefox 27: All field text selected.
  • Safari 7: All field text selected.

PlusAsTab

No cursor movement

  • Chrome 35: Field text is selected, except in <textarea> fields where the cursor remains at the beginning of the field input.
  • Firefox 27: Cursor at the beginning of the field input.
  • Safari 7: Field text is selected, except in <textarea> fields where the cursor remains at the beginning of the field input.

Text selected or cursor moved, unfocus, refocus

  • Chrome 35: The position/selection will be restored when focused again.
  • Firefox 27: The position/selection will be restored when focused again.
  • Safari 7: The position/selection will be restored when focused again.

Request for comments

  1. Should EmulateTab force select all text in <textarea> fields?
  2. @bkwdesign: are you and your users using firefox? What operating system(s)? Can you confirm the above with the same or additional browsers?

joelpurra avatar Mar 01 '14 21:03 joelpurra

Our users are running MSIE 9, Windows 7 environments

bkwdesign avatar Mar 01 '14 21:03 bkwdesign

@bkwdesign: this is still on my todo-list. I have limited time and internet connectivity, and might not be able to work on it in a while. Well tested and formatted patches are welcome!

joelpurra avatar Mar 13 '14 12:03 joelpurra