Closed Bug 127915 Opened 23 years ago Closed 23 years ago

tabindex not working in XUL dialogs

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: law, Assigned: bryner)

Details

Attachments

(1 file)

In the course of trying to get the new page setup dialog (see bug 113727) 
working, I found that using the tabindex= attribute on XUL elements didn't work 
worth a darn.

After some investigation, I found that the mCurrentTabIndex member of 
nsEventStateManager was not being set properly when focusing certain XUL 
widgets (specifically, <textbox>s).  It was keeping its default initial value 
(0) so the tabbing order jumped to the dialgo buttons before going to the 
tab "group" with tabindex="2".

The second panel of this new page setup dialog has a group of 4 <textbox>s (all 
with tabindex="1"), then a group of 3 <menulist>s (with tabindex="2"), then a 
group of 3 more <menulist>s (with tabindex="3".  Focus is initially in the 
first <textbox>.

Tabbing order is through the 4 <textbox>s, then the two buttons, then the first 
3 <menulist>s, then the last 3 <menulist>s.

In addition, clicking in any of the <textbox>s to give it focus didn't affect 
the tab order.  E.g., if focus was on one of the <menulist>s, then clicking in 
a <textbox>, then tabbing, sends focus to the first <menulist> in the group 
that had focus before clicking in the <textbox>.

The theory is that because the <textbox> binding has an <html:input> anonymous 
content element, when focus goes to the <html:input>, the "current tab index" 
is set to zero, rather than the tabindex attribute value of the parent 
<textbox>.
Lo and behold, this is easy to fix by simply propagating the tabindex attribute
from the <textbox> to its child <html:input>.

Brian, can you review?

I'm going to nominate this and try to get it in mozilla0.9.9.
Keywords: nsbeta1
Target Milestone: --- → mozilla0.9.9
Comment on attachment 71560 [details] [diff] [review]
patch for textbox.xml, v1.0

sr=blake
Attachment #71560 - Flags: superreview+
Comment on attachment 71560 [details] [diff] [review]
patch for textbox.xml, v1.0

r=sgehani (Samir was just here and said so)
Attachment #71560 - Flags: review+
Comment on attachment 71560 [details] [diff] [review]
patch for textbox.xml, v1.0

a=asa (on behalf of drivers) for checkin to 0.9.9
Attachment #71560 - Flags: approval+
law has checked this fix in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: madhur → rakeshmishra
Verified on the trunk build 2002-04-24-12-trunk on Windows 2000.
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: