Closed Bug 408595 Opened 17 years ago Closed 14 years ago

focus() puts cursor at end of input field containing a value

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: atiitto, Unassigned)

References

()

Details

(Keywords: testcase)

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Build Identifier: 2.0.0.11

At http://www.luukku.com/ username must be typed before "@luukku.com" and every time logging to the website, keyboard pointer points to the end of the full username. Let "_" indicate keyboard pointer. So, user name box looks like this every time entering to the website: @luukku.com_

Pushing "Home"-button must be done before typing the username. This never happens with Opera and Internet Explorer.

Reproducible: Always

Steps to Reproduce:
1. Refresh the website
2. ...or type the URL to the URL-box and press enter.
3.
Actual Results:  
Problem appears.

Expected Results:  
To put keyboard pointer to the beginning of the username-box, like IE and Opera does.
This bug was originally reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.6 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 2010-07-30]
Version: unspecified → 2.0 Branch
This bug is still present in Firefoxx version 3.6.6.
Whiteboard: [CLOSEME 2010-07-30]
Version: 2.0 Branch → 3.6 Branch
IE and Opera do put pointer at start of field. Safari and Chrome highlight the text in the field. Might make sense if FF did one or the other...
Summary: At http://www.luukku.com/ keyboard pointer points to wrong place → JS: focus() puts cursor at end of input field containing a value
Component: General → DOM: Core & HTML
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → general
Hardware: x86 → All
Version: 3.6 Branch → Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Summary: JS: focus() puts cursor at end of input field containing a value → focus() puts cursor at end of input field containing a value
I really wonders why we should put the cursor at the beginning of the input field?
Can't you use the selection API if you want the cursor to be at a specific position? Like setSelectionRange(0,0);

You can try this:
data:text/html,<body onload="var i=document.getElementsByTagName('input')[0]; i.focus(); i.setSelectionRange(0,0);"><input value="foo">
This is WONTFIX, I think.  If you need specific positioning, you should use setSelectionRange or a similar API.
WONTFIX it is then.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.