Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12366 closed enhancement (fixed)

onFocus()/onBlur() support mixin

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0rc1
Keywords: Cc:
Blocked By: Blocking:


Continuing from #12274, consider create lightweight mixin to get onFocus/onBlur hierarchical support in widgets supplied mainly from focus.js. This is provided from _Widget right now but should be able to get it a-la-carte.

The immediate use would be for ComboBox, not losing it's "focus" status when the user scrolls the drop down. So that involves the code in popup.js... need to analyze this more but adding this ticket as a placeholder for now.

Change History (7)

comment:1 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

(In [24478]) Split off focus manager into a top level dijit/focus module, jettisoning the _base/focus.js selection related code, which isn't being used. _base/focus.js retains that code for backwards compatibility.

Also made _FocusMixin class for any widgets that want the _onFocus()/_onBlur() auto-calling feature from focus manager. Requiring widgets to opt-in to this feature (by mixing in _FocusMixin) avoids focus manager calling _onFocus()/_onBlur() for widgets that have manually setup listeners for onfocus/onblur events to call _onFocus()/_onBlur().

Fixes #12366 !strict.

comment:2 Changed 8 years ago by bill

(In [24481]) Apparently _HasDropDown was just including _Widget to pull in the focus manager? Changed it to use _FocusMixin. Refs #12366 !strict.

comment:3 Changed 8 years ago by bill

Milestone: tbd1.7

comment:4 Changed 8 years ago by bill

(In [25390]) Make dijit/focus.js create dijit.focus "global", as both a function (matching the old dijit.focus() function), and a container for the methods/attributes from the singleton like registerIframe(), curNode etc.

Refs #12366 !strict.

comment:5 Changed 8 years ago by bill

(In [25391]) Explicitly require focus manager, and convert some dijit/_base/focus dependent code to use dijit/focus instead.

Refs #12366 !strict.

comment:6 Changed 8 years ago by bill

In [26468]:

Deregister handles via handle.remove() rather than unregisterIframe()/unregisterWin() methods. Old methods left in back-compat module dijit/_base/focus. Refs #12366, fixes #13851 !strict.

comment:7 Changed 8 years ago by bill

In [27066]:

Add tests for new dijit/focus module. Will keep dijit/tests/_base focus tests around until 2.0, for testing the old API. Refs #12366.

Note: See TracTickets for help on using tickets.