appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 470 forks source link

ToggleButton - setting multiselect=false causes onValueChange to fire twice on button clicks. May also cause infinite loops when changing state. #273

Closed davidklebanoff closed 6 years ago

davidklebanoff commented 6 years ago

Issue Type: bug

Description: When using the ToggleButton component, setting the property multiSelect={false} causes the onValueChange event to fire twice when a button is toggled. Didn't investigate other events or components.

Minimal reproduction of the problem with instructions: https://codesandbox.io/s/n0rkvyw89j

Reactivesearch version: x.y.z 2.2.1

Browser: Tested in Chrome, probably effects all browsers.

davidklebanoff commented 6 years ago

Not sure if this is caused by the same issue or not, but adjusting the state based on onValueChange events causes an infinite loop.

Example: https://codesandbox.io/s/wy396r19zl

divyanshu013 commented 6 years ago

Thanks for reporting the issue @davidklebanoff, this should be out in the next release 😸