Ticket #5613 (closed enhancement: fixed)
Dialog: make focusing on _savedFocus optional for dialog.hide
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1 |
| Component: | Dijit | Version: | 1.0 |
| Severity: | normal | Keywords: | dialog hide focus |
| Cc: |
Description
dialog.hide connects to onEnd of this._fadeOut to set the focus on this._savedFocus. This is the logical and obviously correct behaviour but introduces the following problem: if the dialog changes the content of the page "behind" the dialog and wants to scroll to that change's location, setting the focus on the previously focused element "onEnd" makes the browser scroll right back to that element.
By introducing a new boolean property (e.g. "refocus: true") to the dialog class for programmers to set to "false" (if needed) and performing the following check in the hide function would be very convenient.
if (this.refocus) {
this.connect(this._fadeOut,"onEnd",dojo.hitch(this,function(){
dijit.focus(this._savedFocus);
}));
}
Change History
Note: See
TracTickets for help on using
tickets.