Closed
Bug 147927
Opened 23 years ago
Closed 22 years ago
javascript focus() only moves the cursor not the focus
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: allen.cook, Assigned: bryner)
References
Details
(Keywords: testcase, Whiteboard: [patch])
Attachments
(3 files)
13.24 KB,
text/html
|
Details | |
4.73 KB,
text/html
|
Details | |
665 bytes,
patch
|
blizzard
:
review+
jst
:
superreview+
sspitzer
:
approval1.6a+
|
Details | Diff | Splinter Review |
using the JavaScript .focus() property moves my cursor but not the keyboard focus.
After the call my cursor is in the desired text box; but the focus remains in a
select list; that would have been the next form element. The cursor remains in
the text box assigned by the JavaScript .focus() call: unitl the actual keyboard
focus hits another text box. This does not happen in IE5.5sp2 or NetScape 4.73
![]() |
||
Comment 1•23 years ago
|
||
Browser, not engine ---> DOM Level 0.
Allen, could you provide a reduced testcase or a URL to one?
We need to see exactly what's going wrong. Without that,
we'll have to close this bug. Also, please include the Mozilla
build ID in any bug report you file.
Note to attach a testcase, just go to the URL of this bug,
http://bugzilla.mozilla.org/show_bug.cgi?id=147927, and click
on the "Create a New Attachment" link.
Compare:
bug 120995
<input onblur="this.focus()"> doesn't work, the focus is not set
bug 109962
Text input field doesn't get focus after HTMLInputElement.focus()
(also on the onblur handler)
bug 53579
calling this.blur() in onfocus handler
or this.focus() in an onblur handler do not work
Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
QA Contact: pschwartau → desale
![]() |
Reporter | |
Comment 2•23 years ago
|
||
my current Mozilla build...
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc3) Gecko/20020523
Mozilla 1.0 Release Candidate 3
![]() |
Reporter | |
Comment 3•23 years ago
|
||
includes one element that actually works in IE or Netscape this time.
and one that works in Netscape.
I still have not been able to get this to work in Mozilla.
![]() |
||
Comment 4•23 years ago
|
||
Confirming bug, 2002061008/linux
Another testcase here: http://myxomop.com/bugzilla/focustest.html
![]() |
||
Updated•23 years ago
|
Blocks: focusblink
![]() |
||
Comment 5•23 years ago
|
||
This worksforme on Linux... over to bryner, who may know what's up
Assignee: jst → bryner
![]() |
Assignee | |
Comment 6•23 years ago
|
||
I suspect the checkin for bug 92525 may have fixed this as well. Can someone
re-test?
![]() |
Reporter | |
Comment 7•23 years ago
|
||
Bug is still present with Windows 2000 pro/ mozilla 1.1b 2002072104
However the bug does not exist with
Red Hat Linux 7.2 / mozilla 1.0 2002052918
![]() |
Assignee | |
Comment 8•23 years ago
|
||
Actually, the wrong bug number was cited in the checkin comment. Bug 138191 is
what may have actually fixed this. This was checked in on 7/24; can you please
test a build from 7/25 or newer?
![]() |
Reporter | |
Comment 9•23 years ago
|
||
It's still there used build 2002081218 in both Windows NT and Win 2000 Pro.
Both still have the bug.
Comment 10•23 years ago
|
||
*** Bug 135616 has been marked as a duplicate of this bug. ***
Comment 11•23 years ago
|
||
reporter (Allen): can you reproduce this bug with a recent build of mozilla (for
example, 1.2)? if so, please comment again with details. if not, please resolve
this bug as WORKSFORME. thanks.
![]() |
Reporter | |
Comment 12•23 years ago
|
||
build id: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016
OS Windows 2000 pro
Bug is still present. No change with the build listed above.
![]() |
||
Comment 13•22 years ago
|
||
Reporter: Can you reproduce this bug with a recent build of Mozilla (for
example, 1.4 RC1)? If so, then please comment again with details. If not, then
please resolve this bug as WORKSFORME. Thanks.
Comment 14•22 years ago
|
||
using the second test with Mozilla trunk 2003072704 on win2k, this still happens.
confirming.
Comment 15•22 years ago
|
||
*** Bug 217167 has been marked as a duplicate of this bug. ***
Updated•22 years ago
|
OS: Windows 2000 → All
![]() |
Assignee | |
Comment 16•22 years ago
|
||
I need to test this some more, I'm just putting the patch here so I don't lose
track of it.
![]() |
Assignee | |
Updated•22 years ago
|
Whiteboard: [patch]
![]() |
Assignee | |
Comment 17•22 years ago
|
||
Comment on attachment 130613 [details] [diff] [review]
possible fix
This is a pretty simple change, which is along the same lines as my patch from
bug 53579. That patch caused us to not focus what we thought was the new
focused content if blurring the old content changed the focus. This is really
just a case that I missed there - if the blur handler focused some other
content, we don't want to clear that out by calling SetFocusedContent(nsnull).
Note that this causes us t only null out the focused content in the case where
we _don't_ do an early return below.
Attachment #130613 -
Flags: superreview?(jst)
Attachment #130613 -
Flags: review?(john)
Comment 18•22 years ago
|
||
Comment on attachment 130613 [details] [diff] [review]
possible fix
sr=jst
Attachment #130613 -
Flags: superreview?(jst) → superreview+
![]() |
Assignee | |
Comment 19•22 years ago
|
||
Comment on attachment 130613 [details] [diff] [review]
possible fix
No response from John... blizzard, can you take a look?
Attachment #130613 -
Flags: review?(john) → review?(blizzard)
![]() |
||
Updated•22 years ago
|
Attachment #130613 -
Flags: review?(blizzard) → review+
![]() |
Assignee | |
Comment 20•22 years ago
|
||
Comment on attachment 130613 [details] [diff] [review]
possible fix
Can I get this in for 1.6a? I believe it's pretty safe; I've been running with
it in my tree for some time now.
Attachment #130613 -
Flags: approval1.6a?
![]() |
||
Comment 21•22 years ago
|
||
Comment on attachment 130613 [details] [diff] [review]
possible fix
a=sspitzer for 1.6a
Attachment #130613 -
Flags: approval1.6a? → approval1.6a+
![]() |
Assignee | |
Comment 22•22 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 23•22 years ago
|
||
In case this is considered for the 1.4 branch sometime in the future:
it could cause a regression (bug 232368), see also bug 118685.
You need to log in
before you can comment on or make changes to this bug.
Description
•