Open Bug 173556 Opened 22 years ago Updated 2 years ago

Add firstfocus attribute to dialog tag

Categories

(Core :: XUL, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: mikeypotter, Unassigned)

Details

I think it would be useful to have a firstfocus attribute on the XUL <dialog>
tag, so that you could easily specify which element you would like to have the
initial focus.
I believe that adding the following code to dialog.xml should do the trick (in
the <constructor>): 

if( this.getAttribute( "focusfirst" ) != "" )
{
  if( document.getElementById( this.getAttribute( "focusfirst" ) ) )
  {
     document.getElementById( this.getAttribute( "focusfirst" ) ).focus();   
  }
}
You should make this work using tabindex, not firstfocus.  XUL elements are supposed to 
support tabindex, and that would be a means of identifying the first focusable control.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
Assignee: hyatt → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.