JavaScript can move the focus to a form on another tab without changing the displayed tab

VERIFIED DUPLICATE of bug 124750

Status

()

Core
Event Handling
VERIFIED DUPLICATE of bug 124750
15 years ago
14 years ago

People

(Reporter: Stewart, Assigned: saari (gone))

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030727
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030727

While I was loading daily links into new tabs, I loaded the Yahoo sign-in page
into a new tab (using a middle-click), followed by the PayPal login (also into a
new tab, via a middle-click).  When I went to the Yahoo tab and started to type
in my name and password, the cursor disappeared suddenly while I was typing, and
some of my password ended up on the PayPal form while I was still looking at the
Yahoo tab.  (I discovered where my password went later, while moving through my
other open tabs.)

Apparently, the JavaScript focus control works even when the contents of its tab
are not currently displayed, without changing the displayed tab.

Reproducible: Always

Steps to Reproduce:
1. Get a slow connection or move swiftly.
2. From a single starting page with a link to the PayPal login page and/or a
link to the Yahoo login page, but also including a text form for you to type in.
3. Middle click on either (or both) of the links.
4. Type into your text form.  It doesn't matter what, much.  Just keep typing.
5. When the other tab(s) finish loading, your cursor will vanish.  Keep typing
for a few moments more so you can see where your input went.

Actual Results:  
The end of my password went into a username field on another tab.  It's a good
thing I noticed that the cursor was gone before I pressed enter.


Expected Results:  
Good question.  Either tabs that are not displayed shouldn't be able to get
focus via JavaScript, or the tab containing the element getting focus should be
displayed.

(Personally, I _hate_ it when I'm interrupted while typing.  I'd prefer the
first option, so my quick fingers [80WPM sustained, 120WPM bursts] don't send
anything.  Still, though, when I finally move on to that tab, it'd be nice if
the element that was intended to get focus would be focused at that point.)

Someone here is suggesting another possible solution:
1. Check if the keyboard is being typed on at the moment (within the last second).
2. If so, DON'T INTERRUPT -- delay the JavaScript, pause/suspend it until the
user is done typing [as defined above], etc.
3. When switching tabs, switch the displayed tab too.
(Reporter)

Comment 1

15 years ago
Created attachment 130757 [details]
A page with links and a text entry field

Comment 2

15 years ago
maybe related: Bug 104532 Status bar ticker fails to update when tabs switched.

Comment 3

15 years ago
This is bug 124750
(Reporter)

Comment 4

15 years ago
I agree, it is.  I wonder why my search didn't turn it up, though...

*** This bug has been marked as a duplicate of 124750 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.