question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calling enter() doesn't fire enter hook.

See original GitHub issue

Because 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
taufik-nurrohmancommented, Oct 30, 2018

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:

$.enter = function(bucket) {
    return create(0, bucket), trigger("enter", [$]), $;
};
0reactions
taufik-nurrohmancommented, Nov 2, 2018

Now they are removed. You could simply use this:

picker.on("fit", function() {
   console.log(["picker.on fit was fired...", this]);
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Function in React isn't firing after 'enter' key is pressed
I want it so after the user hits enter in an input field it fires a function. It wont' fire the function however....
Read more >
Prevent enter key from submitting · Discussion #2549 - GitHub
I'd like to prevent the enter key from submitting. I have a MUI Textfield that I'm using as an autocomplete. If the user...
Read more >
Invalid Hook Call Warning - React
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >
How the useEffect Hook Works (with Examples) - Dave Ceddia
Need to fetch data with the useEffect hook? Or run code on mount? Or when state changes? This post covers these useEffect examples...
Read more >
Keyboard: keydown and keyup - The Modern JavaScript Tutorial
There's another event named input to track changes of an <input> field ... The check like event.code=="keyZ" won't work: the first letter of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found