Ticket #5858 (new defect)

Opened 5 months ago

Last modified 4 months ago

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

Reported by: bill Owned by: bill
Priority: normal Milestone: 2.0
Component: Dijit Version: 1.0
Severity: normal Keywords:
Cc:

Description (last modified by bill) (diff)

_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

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

Change History

Changed 5 months ago by guest

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

Changed 5 months ago by guest

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

Changed 5 months 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

Changed 5 months ago by bill

  • description modified (diff)

Changed 5 months ago by bill

  • owner set to bill

Changed 5 months 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

Changed 5 months 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

Changed 4 months 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)

Changed 4 months ago by bill

  • summary changed from _base/test_FocusManager.html "restore focus" button failing to _base/test_FocusManager.html "restore focus" button failing (Safari)
  • milestone changed from 1.1 to 2.0
Note: See TracTickets for help on using tickets.