Closed Bug 617507 Opened 14 years ago Closed 13 years ago

Page does not regain focus after clearing a modal prompt

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla6

People

(Reporter: jbalogh, Assigned: Dolske)

References

()

Details

(Whiteboard: [testday-20110422])

Seen on gmail: after clearing a modal prompt by pressing Enter, I can't interact with gmail keyboard shortcuts until I click on the page again.  The first thing highlighted after pressing <tab> is the page's tab.

Here's a demo: http://people.mozilla.com/~jbalogh/keypress.html

The page captures keypress events, but that stops happening after an alert() is triggered until you click on the page again.
Hmm. I was expecting bug 613763 to have fixed this, but the testcase here still isn't working with a current nightly.
Assignee: nobody → dolske
OS: Mac OS X → All
I can not reproduce on latest m-c nightly any more.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20110109 Firefox/4.0b9pre ID:20110109030350
Another testcase attachment 502415 [details] on Bug 624307

Content focus will be lost after closing alert box, I can not scroll contents by keyboard until I click on contents again.
For the testcases here, focus manager's .focusedElement is null before and after the prompt.

I think the problem here is that there isn't actually a focusable element in the page and so something else (the window?) is what has focus. I'm not sure how to get/set whatever that is, though... Enn?

We do return focus into the page (from bug 613763), and you can see this if you put an <input type="text"> into the testcase and modify the "click me" to trigger the alert after a short delay (so you can refocus the text box)... Focus returns to the textbox after closing the prompt.
You'd need to focus the <browser> element. In fact, you should be able to just do that instead of focusing the element.
Bug 617507 notes that if you get multiple prompts, closing one should focus the other. So we probably want to set focus not just to the <browser> (per comment 7), but the outer <stack> or even <tabpanel>.
Bug 638352 should fix this.
Depends on: 638352
Marking fixed, bug 638352 just landed.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
WinXP SP3 32 Bit

Mozilla/5.0 (Windows NT 5.1; rv:6.0a1) Gecko/20110421 Firefox/6.0a1 ID:20110421030547

The bug has been fixed
Status: RESOLVED → VERIFIED
Whiteboard: [testday-20110422]
You need to log in before you can comment on or make changes to this bug.