Add firstfocus attribute to dialog tag

NEW
Unassigned

Status

()

16 years ago
9 years ago

People

(Reporter: mikeypotter, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
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();   
  }
}

Comment 1

16 years ago
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.

Updated

10 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets

Updated

9 years ago
Assignee: hyatt → nobody
You need to log in before you can comment on or make changes to this bug.