Opened 10 years ago

Closed 9 years ago

#10404 closed defect (fixed)

TooltipDialog: focus lost on close (IE)

Reported by: bill Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit Version: 1.4.0b
Keywords: Cc: Nathan Toone
Blocked By: Blocking:

Description (last modified by bill)

Saw this on IE7, not sure about other browsers.

  1. In test_TooltipDialog.html open the first TooltipDialog
  2. tab to DateTextBox
  3. press ESCAPE (it will close the drop down calendar)
  4. press ESCAPE again (it will close the drop down)

At this point focus should be on the button, but (at least on IE7) it's apparently moved to the <body>. Pressing TAB moves focus to the first button, rather than to the second button.

Change History (6)

comment:1 Changed 10 years ago by bill

Description: modified (diff)

comment:2 Changed 10 years ago by bill

Summary: TooltipDialog: focus lost on close (IE7)TooltipDialog: focus lost on close (IE)

Seeing the same problem in the robot/Toolbar.html test. Steps to manually reproduce:

  1. open test_Toolbar.html
  2. tab into first toolbar and right-arrow to TooltipDialog DropDown button
  3. down arrow to open dialog and focus on first field
  4. tab twice to OK button
  5. ENTER key

At this point focus should move back to the DropDown button. Actual result: it moves there temporarily then jumps to <body>.

comment:3 Changed 10 years ago by bill

Cc: Nathan Toone added

The _HasDropDown code looks suspicious. It closes the drop down first then shifts focus to the around node, whereas on IE we know that sometimes closing the node w/focus causes problems:

dijit.popup.close(this.dropDown);
if(focus){ this.focus(); }
     ...

However IIRC I tried reversing those two lines and it didn't fix this problem.

comment:4 Changed 9 years ago by bill

(In [22191]) When closing a drop down, refocus the parent widget before closing the drop down, rather than after. This avoids a momentary focus onto <body> which causes problems with nested drop downs, when they all close, rather than just the top one. Refs #11132 (mostly fixing it), thanks to Xiao Wen W Zhu/Doug? Hays for patch.

comment:5 Changed 9 years ago by bill

Owner: set to bill
Status: newassigned

comment:6 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22236]) Fix IE focus problems in the robot tests Toolbar.html and TooltipDialog.html.

Show/hide of popups was implemented via dynamic addition/deletion of DOM nodes to the document. Those dynamic additions/deletions caused the current node to lose focus, or when the user tabs to a new field it gets focus momentarily but then focus jumps to <body>.

Best solution I could come up with was to pre-create the popup wrapper <div> and then not recycle wrapper <div> or <iframe> (although a possible optimization would be to recycle the iframe).

Fixes #10404, #11193, refs #11132, #10016, #10167 !strict.

Note: See TracTickets for help on using tickets.