Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(SearchBox): avoid to bind click on reset button #979

Merged
merged 1 commit into from
Feb 16, 2018

Conversation

samouss
Copy link
Collaborator

@samouss samouss commented Feb 15, 2018

Summary

Fix #926

In the current implementation we bind the form with a onReset handler. But the reset button is also bound with the same callback onClick. So when the form is clear by clicking on the button two events are triggered (and so two queries). The first is trigger by the form & the second one by the button.

We don't need to bind the second handler on the reset button. Because the click will trigger the reset event on the form.

Before:

before

After:

after

@samouss samouss requested review from vvo, bobylito and Haroenv February 15, 2018 19:16
@algobot
Copy link
Contributor

algobot commented Feb 15, 2018

Deploy preview for react-instantsearch ready!

Built with commit 31d9d74

https://deploy-preview-979--react-instantsearch.netlify.com

@samouss samouss force-pushed the fix/search-box-clear branch from f41d180 to 31d9d74 Compare February 16, 2018 08:31
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wholly approve of this!

@samouss samouss merged commit ea3063a into master Feb 16, 2018
@samouss samouss deleted the fix/search-box-clear branch February 16, 2018 09:09
samouss added a commit that referenced this pull request Mar 6, 2018
<a name="4.5.2"></a>
## [4.5.2](v4.5.1...v4.5.2) (2018-03-06)

### Bug Fixes

* **connectRange:** update default refinement propTypes ([#978](#978)) ([c065fb1](c065fb1))
* **IndexUtils:** avoid throw an error when cleanUp multi index ([#1019](#1019)) ([865a3c3](865a3c3))
* **SearchBox:** avoid to bind click on reset button ([#979](#979)) ([ea3063a](ea3063a))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants