Closed
Bug 277482
Opened 20 years ago
Closed 20 years ago
[FIX]Input field does not get focus set by Javascript on load
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P1)
Core
DOM: UI Events & Focus Handling
Tracking
()
VERIFIED
FIXED
mozilla1.8beta1
People
(Reporter: mozilla, Assigned: bzbarsky)
Details
(Keywords: regression)
Attachments
(2 files)
207 bytes,
text/html
|
Details | |
1012 bytes,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20050106 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20050106 Firefox/1.0+
MS Exchange webmail uses html like that attached in Firefox 1.0 (and IE 6) the
input filed has focus set when the page loads. This means you can immediately
start typing your username. In FF 1.0+ focus is not set, and you have to
manually set it before typing.
Reproducible: Always
Steps to Reproduce:
1. Load the attached html file
2.
3.
Actual Results:
focus is not set on input field
Expected Results:
focus should be set on input files
Reporter | ||
Comment 1•20 years ago
|
||
Reporter | ||
Updated•20 years ago
|
Keywords: regression
Comment 2•20 years ago
|
||
use a different method:
(your method is the IE-way, this is the W3C way)
<html>
<body>
<form name="logonForm">
<input name="mailbox" value="" size="20" type="text">
<script language="JavaScript">
document.forms[0].elements[0].focus();
</script>
</form>
</body>
</html>
works fine
INVA ?
Comment 3•20 years ago
|
||
or when you prefer to call elements direct
<html>
<body>
<form id="logonForm">
<input id="mailbox" value="" size="20" type="text">
<script type="text/javascript">
document.forms['logonForm'].elements['mailbox'].focus();
</script>
</form>
</body>
</html>
Updated•20 years ago
|
Assignee: bugs → events
Component: Form Manager → Event Handling
Product: Firefox → Core
QA Contact: form-manager → ian
Version: unspecified → Trunk
Reporter | ||
Comment 4•20 years ago
|
||
Thanks for the explanation as to why it does not work. However, why has the
behaviour changed? A lot of people use MS webmail, and this change means that
you have to reach for the mouse while logging in.
Comment 5•20 years ago
|
||
document.formName.formElementName is not "the IE-way", it's as old as
JavaScript: the testcase works as expected in Navigator 2.02.
Regression window: works in 1.8a2 2004052410, fails in 1.8a2 2004052810.
Assignee | ||
Comment 6•20 years ago
|
||
This regressed when FlushPendingNotifications got more fine-grained. We used
to flush out everything for the content list accesses in that JS, now we just
flush content.
The result is that frames may not be up-to-date yet when focus() is called. So
we should make sure to flush them out in focus().
Assignee: events → bzbarsky
Status: NEW → ASSIGNED
Attachment #173010 -
Flags: superreview?(jst)
Attachment #173010 -
Flags: review?(jst)
Assignee | ||
Updated•20 years ago
|
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Summary: Input field does not get focus set by Javascript on load → [FIX]Input field does not get focus set by Javascript on load
Target Milestone: --- → mozilla1.8beta
Comment 7•20 years ago
|
||
Comment on attachment 173010 [details] [diff] [review]
Fix
r+sr=jst
Attachment #173010 -
Flags: superreview?(jst)
Attachment #173010 -
Flags: superreview+
Attachment #173010 -
Flags: review?(jst)
Attachment #173010 -
Flags: review+
Assignee | ||
Comment 8•20 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•20 years ago
|
||
Verified fixed Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b)
Gecko/20050201 Firefox/1.0+
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•