Closed Bug 1050768 Opened 10 years ago Closed 8 years ago

Tabbing steals focus with javascript textbox.focus()

Categories

(Firefox :: Untriaged, defect)

31 Branch
x86_64
Windows 7
defect
Not set
major

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: debra.l.elliott, Unassigned)

References

()

Details

(Keywords: testcase-wanted)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140716183446

Steps to reproduce:

http://facltest.org/index.php?option=com_content&view=article&id=4&Itemid=178.  The phone fields demonstrate the bug on this form.  I specifically set javascript element.focus() to come back to the textfield when the phone format is not what's expected.  When tabbing, it doesn't obey this javascript command.  


Actual results:

It put focus on the next tab item (text box) after tabbing.


Expected results:

It should have kept focus on the original text box.  All other browsers do it correctly, except firefox.
Severity: normal → major
What are the exact STR on your page?
Flags: needinfo?(debra.l.elliott)
I'm not sure what you mean by "STR".  The validation is converting phone to (###) ###-#### format.  If you type something less than 10 digits, it will turn the text box red and the focus is directed back to the textbox.  If you hit return in Firefox, this works.  If you hit tab after entry, the box is turned red, but the focus is on the next textbox in the tab order.  This is the part that is not right.  Other browsers make the action after tabbing the same as hitting return.
Flags: needinfo?(debra.l.elliott)
STR = Steps To Reproduce.
It means you have to detail step by step what the user needs to do on that webpage to repro the bug.
But now, I guess, your last comment is enough to repro the bug quickly. I'll try.
[bugday-20140811]
I can reproduce this but is it a bug or normal behavior? Tested in IE11 and it behaves the same as Firefox in this regard. Actually, Firefox clears the box when I hit ENTER while IE11 does nothing. Both clear the box and set the focus to the next box when I hit TAB.
My code is specifically (in javascript) telling it to clear the box and then put focus back on it.  If you test with chrome, opera or safari, you will see that they operate in this manner and abide by the focus() command in javascript.  I consider it a bug and confusing that firefox ignores the command to return focus to the text element after a tab but not on a return.  It should be the same as the return/enter action.
Hi Debra,

Are you still having this issue?
Flags: needinfo?(debra.l.elliott)
http://facltest.org/index.php?option=com_content&view=article&id=4&Itemid=178 is dead, so this lacks a testcase
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(debra.l.elliott)
Keywords: testcase-wanted
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.