Ticket #5613 (closed enhancement: fixed)

Opened 10 months ago

Last modified 9 months ago

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

Changed 10 months ago by peller

  • milestone deleted

Changed 9 months ago by bill

  • summary changed from make focusing on _savedFocus optional for dialog.hide to Dialog: make focusing on _savedFocus optional for dialog.hide

Changed 9 months ago by dante

  • status changed from new to closed
  • resolution set to fixed

(In [12449]) fixes #5613 - introduces an optional 'refocus' attrib to dialog, so you can (while the dialog is open) change the intended focus after closing.

Changed 9 months ago by peller

  • milestone set to 1.1
Note: See TracTickets for help on using tickets.