1egoman / fuzzy-picker

:mag: React component that implements a fuzzy picker (like sublime text's command pallete, or slack's channel switcher).
https://1egoman.github.io/fuzzy-picker
MIT License
76 stars 9 forks source link

Fire a callback when the fuzzy-finder is opened #23

Open ivangalbans opened 5 years ago

ivangalbans commented 5 years ago

I would like a callback OnOpen like OnClose.

My question is: How can I execute a function when fuzzy-finder is opened ? This functionality is very useful

1egoman commented 5 years ago

The easiest way is to manage focus on your own - ie, using the "controlled" method. When you handle the keypress or other opening mechanism, you can call whatever initialization logic you'd like.

ivangalbans commented 5 years ago

Yes, it works but I think it's easier to have an OnOpen callback. If this is possible, of course.

1egoman commented 5 years ago

If it's something that you'd like to do, feel free to make the change and open a pull request - if it looks good I'd merge it! This isn't something that I have a need for though (and don't have time to prioritize it right now).