Closed
Bug 58853
Opened 24 years ago
Closed 23 years ago
Dialog boxes should always get initial keyboard focus
Categories
(Core :: DOM: UI Events & Focus Handling, enhancement, P3)
Core
DOM: UI Events & Focus Handling
Tracking
()
VERIFIED
FIXED
mozilla1.1alpha
People
(Reporter: aaronlev, Assigned: aaronlev)
References
(Blocks 1 open bug)
Details
(Keywords: access)
Attachments
(2 files, 1 obsolete file)
1.15 KB,
patch
|
Details | Diff | Splinter Review | |
2.49 KB,
patch
|
Details | Diff | Splinter Review |
When first entering a dialog box, there should always be an inital keyboard focus.Right now you usually need to press TAB an extra time to get your focus somewhere. A side effect of there not being an initial focus, is that confirm/cancel dialogs require TAB for space hits the OK button.
Comment 1•24 years ago
|
||
I'd put this higher than an enhancement, its a bug.
Comment 3•24 years ago
|
||
See also bug 35087, dialog with one text field should set focus (programmers shouldn't have to manually set focus for each dialog).
Comment 4•24 years ago
|
||
Since Don has left, Vishy is taking his bugs in bulk, pending reassignment. thanks, Vishy
Assignee: don → vishy
Comment 6•24 years ago
|
||
Not just with buttons. If it has a textfield, that gets focus first. Only for common dialogs, though (alerts, etc.)
Assignee | ||
Comment 7•24 years ago
|
||
Okay, hopefully we're still going to make this the default behavior for any UI window that's opened, not just common dialogs.
Comment 11•24 years ago
|
||
This is soo far off my radar for this release it isn't even funny. If you want this fixed in that time frame, assign it to Aaron or someone else.
Assignee | ||
Comment 12•24 years ago
|
||
I should be able to handle this in a couple of weeks, when the XUL content model moves back into layout (Waterson's change). Hyatt and I were talking about leveraging the GetNextTabbableContent method in nsEventStateHandler, and exposing it in the XUL DOM through document.commandDispatcher.getNextTabbableContent(BOOL forward). I'd solve the problem as follows: in the XBL binding for <window class="dialog" ...> onload handler we check to see if the focus is already on a specific element (not the window as a whole). If it isn't, we move it to the first item using GetNextTabbableContent. If the first item is a tab widget, move it beyond the tab widget (this makes Ben Goodger happy). This solution works whether our onload handler gets called after the dialog's, or before it. If it gets called first, the window's handler still gets a chance to set focus. If it gets called after the window handler set a focus, we won't do anything because we check to see if the focus was already set. Therefore, we don't need to worry about the outcome of any bugs having to do with the order of onload event handling.
Assignee | ||
Updated•23 years ago
|
Comment 14•23 years ago
|
||
I have implemented this in my tree. jst and saari have reviewed. aaronl, I can take this bug off your hands if you want.
Assignee | ||
Comment 15•23 years ago
|
||
How'd you do it? Did you expose GetNextTabbableContent like we talked about?
Assignee: aaronl → hyatt
Status: ASSIGNED → NEW
Comment 16•23 years ago
|
||
i presume this bug covers the fact that the following dialogs don't have initial focus set [if so, it goes hand in hand with bug 76814]: Preferences Account Settings Customize Sidebar Cookie Manager Image Manager Password Manager both dialogs dealing with form data management for me this is primarily a problem on linux and mac [not so much on win32].
Comment 17•23 years ago
|
||
*** Bug 82384 has been marked as a duplicate of this bug. ***
Comment 18•23 years ago
|
||
Add the Address Book, "Card for <name>" dialog to this list. Dup'd bug 82384. 1.Open the Address Book 2.Open an existing AB entry by either double clicking or using the Edit menu. 3."Card for <name>" dialog opens but nothing has focus. Expected: The first text field, "First" name should have focus.
Comment 19•23 years ago
|
||
There is a method on the commandDIspatcher now that will do this. If ben ever gets around to making a <dialog> binding, he should be able to build the focus advancement into the binding behavior.
Comment 20•23 years ago
|
||
It shouldn't be specific to <dialog>s -- <window>s should have default focus set too, though many of them will adjust the focus themselves.
Assignee | ||
Comment 21•23 years ago
|
||
*** Bug 91700 has been marked as a duplicate of this bug. ***
Comment 22•23 years ago
|
||
the lack of initial key focus for enter/esc (ok/cancel) in dialogs is embarrasing. why is this 1.1?
Comment 23•23 years ago
|
||
It is 1.1 because dialog writers can set initial focus in onenddocumentload, and because we don't want to go mucking around with focus and changing behavior unless we really, really have to. Why, just this weekend the inital focus screwed up rendering from jag's patch. You're more than welcome to try and fix it if you want pink.
Comment 24•23 years ago
|
||
*** Bug 76814 has been marked as a duplicate of this bug. ***
Comment 25•23 years ago
|
||
*** Bug 97578 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 26•23 years ago
|
||
Assignee | ||
Comment 27•23 years ago
|
||
I'm guessing this patch works because it delays advanceFocusIntoSubtree() until the the frame tree has been created. It doesn't fix the account wizard, which doesn't seem to use either <dialog /> or <wizard />. In fact, nothing seems to use <wizard>, so I'm not sure why we have wizard.xml at all.
Comment 28•23 years ago
|
||
Yeah, that's right. <wizard> is new, nobody is using it yet, but they should be. :) sr=hyatt. Feel free to take the bug, aaronl.
Comment 29•23 years ago
|
||
I checked in the patch to fix bug 103036.
Assignee | ||
Comment 30•23 years ago
|
||
I can't mark this fixed because it doesn't seem to fix all windows, only those created with <dialog>
Assignee: hyatt → aaronl
Assignee | ||
Comment 31•23 years ago
|
||
Assignee | ||
Comment 32•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #52199 -
Attachment is obsolete: true
Comment 33•23 years ago
|
||
Trying to bind to window causes many problems. FOr now, you just can't do it. Anyway the better solution is to start converting the dialogs over to <dialog>.
Assignee | ||
Comment 34•23 years ago
|
||
Wizards are still a problem. They have been spun off to bug 103348
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 35•23 years ago
|
||
vrfy fixed --at least for Prefs, Find and the helper app dialog. bugs for specific dlgs should be/have been filed seperately. :)
Status: RESOLVED → VERIFIED
Updated•5 years ago
|
Component: Keyboard: Navigation → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•