Opened 11 years ago

Closed 10 years ago

#5858 closed defect (fixed)

_base/test_FocusManager.html "restore focus" button failing (Safari)

Reported by: bill Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

_base/test_FocusManager.html "restoreFocus" button seems to have no effect on FF2/win, FF3/mac, or safari. See http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/_base/test_FocusManager.html

Actually, this was also broken in 1.0 branch (see http://download.dojotoolkit.org/release-1.0.2/dojo-release-1.0.2/dijit/tests/_base/test_FocusManager.html):

FF2/win, IE6: same problem FF3/mac: error that dijit.getEnclosingWidget not found?!

Attachments (2)

window.js.diff (436 bytes) - added by guest 11 years ago.
[cla] [patch] (nicola.rizzo+dojo@…) arguments must be passed even if context object is undefined
focus.js.diff (486 bytes) - added by guest 11 years ago.
[cla] [patch] (nicola.rizzo+dojo@…) omitted "this"

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by guest

Attachment: window.js.diff added

[cla] [patch] (nicola.rizzo+dojo@…) arguments must be passed even if context object is undefined

Changed 11 years ago by guest

Attachment: focus.js.diff added

[cla] [patch] (nicola.rizzo+dojo@…) omitted "this"

comment:1 Changed 11 years ago by guest

Works in FF2/Linux and IE6/wine. Not sure if there is a problem with "apply(context, cbArguments | | [ ])" in other browsers when context is undefined.

Nicola

comment:2 Changed 11 years ago by bill

Description: modified (diff)

comment:3 Changed 11 years ago by bill

Owner: set to bill

comment:4 Changed 11 years ago by guest

With focus.js.diff and window.js.diff (window.js.diff is related to /dojo/_base/window.js) works for me also in IE7, Safari 3.0.3/win and FF2/win.

Nicola

comment:5 Changed 11 years ago by guest

Bill,
in 1.0 branch dijit.getEnclosingWidget is defined in manager.js, but focus.js doesn't call a dojo.require("dijit._base.manager"). In dijit/_base.js "dijit._base.manager" is required after "dijit._base.focus".
hth,

Nicola

comment:6 Changed 11 years ago by bill

(In [12662]) Refs #5858: _base/test_FocusManager.html "restore focus" button failing. This gets the code working on IE and FF, but not Safari...

The focus API tries to be clever, and (in this example) saves not what is actually in focus (ie, the save button itself), but what was in focus immediately before the save button was pressed. That code fails on Safari since the save button never gets focus. Need to rethink or desupport this API since I suspect the current code will fail on IE/FF if it's called when nothing is in focus: it will save whatever used to be in focus, even if that was 10 minutes earlier. Will rethink for 2.0.

Patch partly from Nicola (CLA on file)

comment:7 Changed 11 years ago by bill

Milestone: 1.12.0
Summary: _base/test_FocusManager.html "restore focus" button failing_base/test_FocusManager.html "restore focus" button failing (Safari)

comment:8 Changed 10 years ago by bill

Description: modified (diff)
Milestone: 2.01.4
Resolution: fixed
Status: newclosed

It's working now, I think from Jared's work on the focus.js code.

Note: See TracTickets for help on using tickets.