Opened 14 years ago
Closed 14 years ago
#2780 closed defect (fixed)
ModalDialogBase tries to set focus on invisible element on IE, IE complains loudly
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 0.9beta |
Component: | Dijit | Version: | 0.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The ModalDialogBase?.trapTabs function doesn't take into account that IE won't let you set focus on an element that is hidden or otherwise invisible. When it calls tabEnd.focus() or tabStart.focus() IE6 sometimes puts up its error dialog about not being able to set the focus to an element that is hidden, not visible or disabled.
This can be prevented by wrapping the calls to focus() in a try/catch block. On IE there really isn't a good way to tell if an element fits the criteria where the call would fail, other than simply calling focus() and letting it fail.
ex: try { this.tabEnd.focus() } catch (ex) {}
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Component: | General → Dijit |
---|---|
Owner: | changed from anonymous to bill |
is this still an issue in dijit?
comment:3 Changed 14 years ago by
Milestone: | → 0.9beta |
---|---|
Resolution: | → fixed |
Status: | new → closed |
No, I think with Becky's change we are never setting focus to an invisible element.
(In [8594]) defensive CSS. Makes the menu show up w/o the 1-2 em padding that it had on the test page. Refs #2780