Open
Bug 565545
Opened 15 years ago
Updated 3 years ago
Autofocusing a string field using JS doesn't select an existing string
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: limi, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [Advo])
Attachments
(1 file)
477 bytes,
text/html
|
Details |
(Note: this is filed as part of the “Paper Cut” bugs — we assume that there may be multiple existing bugs on this. Please make them block this bug, and we will de-dupe if they are indeed exactly the same. Thanks!)
To reproduce:
1. Go to a form that uses JS to autofocus a string input field that is already populated (e.g. edit forms in CMS software)
2. We put the cursor at the end of the string, whereas other browsers select the existing string.
3.
Recommendation:
When autofocusing a string field with an existing value, it's more likely that it's done because you want to replace the contents of that string field. It's also more consistent with what other browsers do (Safari, relatively certain IE does that too)
Comment 1•15 years ago
|
||
Both Firefox and Safari "remember" your selection or insertion point if you leave a textbox and return using a focus() call. The only difference is that if a textbox is *first* focused using a focus() call, Safari selects it all and Firefox puts the insertion point at the end.
Should we try to match Safari, or should we always select the entire text?
Updated•15 years ago
|
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
I much prefer Safari's approach here. If I have never focused the input, select the whole thing. If I have touched it before, I would absolutely expect the cursor to be where I left it.
Updated•13 years ago
|
Whiteboard: [Advo]
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•