darianstlex / react-sm-select

React Multi/Single Select
https://darianstlex.github.io/react-sm-select
MIT License
6 stars 2 forks source link

Stop Event Propagation onClick #2

Closed ghost closed 5 years ago

ghost commented 5 years ago

Thanks for this awesome react select library, i really enjoy using it. Unfortunately, when clicking on the header to open the dropdown, the event is bubbling up, causing to trigger another event in my application. When capturing the onClick-event, the dropdown does not open anymore. Using the key-down/up works just fine. I had a quick look into the src. Could it be possible to change the onClick behaviour in the MultiSelect class:

onClick={() => this.toggleDropDown()}

to make it similar to the behaviour when pressing the keys?

Thanks!

darianstlex commented 5 years ago

Hi, thanks for the quick solution, will try to fix it in the next few days

darianstlex commented 5 years ago

The PR is done, can you check if this fix is working for you pls: bug/fix-click-propagation #3 Also thinking to make it optional Add stopClickPropagation

Thanks

darianstlex commented 5 years ago

Closing it, as it seems it's not needed anymore if so, reopen

ghost commented 5 years ago

Sorry for delay. I've just checked the PR and it works like a charm.

Thank you very much.

darianstlex commented 5 years ago

released: 1.0.8