Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#9447 closed defect (fixed)

test_FocusManager save bookmark broken in Safari

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

Description

http://archive.dojotoolkit.org/nightly/checkout/dijit/tests/_base/test_FocusManager.html

If you select a textbox, then click save selection, the console says that the node and bookmark are null.

Change History (4)

comment:1 Changed 9 years ago by bill

Milestone: tbd1.4
Status: newassigned
Summary: test_FocusManager save bookmark broken in Safari 4test_FocusManager save bookmark broken in Safari

The bookmark returned in that test file is broken on all browsers... I think it only works when getFocus() is called programatically, not when the user needs to press a button.

The issue is that merely pressing the "Save focus/selection state" button removes focus from the previously-focused <input>/<textarea>, and thus de-selects whatever text was selected.

As for the node being null, that is a bug, although it also occurs on Safari 3.2.1 according to my tests. It's because pressing the button on safari removes focus altogether, which is different than IE, where pressing a button makes the button itself gets focus.

I think I can compensate for safari's different behavior by returning the previously focused node if current focus is null... similar to how getFocus() returns the previously focused node if the current focus is the button. However, I want to be sure that I don't return a previously-previously focused node, in the case where:

  1. user clicks an input
  2. user clicks a blank area of the screen (clearing all focus)
  3. getFocus() is called programatically (perhaps because a Dialog popped up and the Dialog wants to know where to return focus to)

comment:2 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [18534]) Fix getFocus() on safari, and add unit test. Fixes #9447 !strict.

comment:3 Changed 9 years ago by bill

Note that since this occurs on Safari 3 also, I don't think the fix needs to be backported to the 1.3 branch. We could though, it seems pretty safe.

comment:4 Changed 8 years ago by bill

(In [20262]) autocomplete=false doesn't work (at least not on FF), autocomplete=off is correct. Refs #9447.

Note: See TracTickets for help on using tickets.