Calling enter() doesn't fire enter hook.
See original GitHub issueBecause of my issues with visibility
not updating, I’m having to manually manage my own visibility flag using the enter
and exit
hooks. This works pretty good except if I open the color picker manually with another button using:
CP.__instance__.someColorPicker.enter()
The enter
hook doesn’t get fired. This would be expected behavior no? As then I could put all my flag management code in one place - the enter
and exit
hooks versus having to add code wherever I call enter()
.
Strangely, calling the above with exit()
does indeed fire the exit
hook.
This can be reproduced easily by putting a console.log
in the picker.on('enter') {}
, create a new color picker instance, then in Chrome’s console call CP.__instance__.someColorPicker.enter()
. It won’t fire the enter
hook. However, it will fire if you manually click the color picker to enter it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
SIGH! It turns out that it’s because we lost the
enter
hook from the start. ~I can’t find it with CTRL+F~ (2018/10/30 04:20 AM: my bad, I can find it LOL).A small change here should fix the issue:
Now they are removed. You could simply use
this
: