emulatetab
emulatetab copied to clipboard
Inconsistency if field text will be selected on field focus
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
- Should EmulateTab force select all text in
<textarea>
fields? - @bkwdesign: are you and your users using firefox? What operating system(s)? Can you confirm the above with the same or additional browsers?
Our users are running MSIE 9, Windows 7 environments
@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!