This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
fix(setSearchBoxValue): reset searchbox before editing #15
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tkrugg
changed the title
Update setSearchBoxValue.ts
fix(setSearchBoxValue): reset searchbox before editing
Nov 20, 2019
In React and Preact the CLEAR selenium instruction does not fire any event, and therefore does not update the component's internal state (see this job for example: https://app.saucelabs.com/tests/4518f96fdfd447e998786d0ff463658a#54) It is equivalent to `input.value = ''`. There are multiple sources reporting a similar behaviour (see SeleniumHQ/selenium#6741) Since this change: algolia/instantsearch#4202 ```jsx <input value={state.query} /> ``` instead of ```jsx <input value={props.query} /> ``` Since binding the input value to a `state.query` (rather than a `props.query`), it appears the click we use to focus on the searchbox re-syncs `input.value` with `state.query`.
tkrugg
force-pushed
the
reset-searchbox-before-setting-value
branch
from
November 21, 2019 12:55
2d232b3
to
3b531c6
Compare
Haroenv
approved these changes
Nov 21, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that since your PR in InstantSearch, you will no longer be able to set the value externally?
yannickcr
approved these changes
Nov 21, 2019
@Haroenv you were never able to, the component always worked in a controlled way. Only the clear instruction of selenium uses
|
I ran the current PR on vue-instantsearch@develop, react-instantsearch@master and instantsearch.js@develop and it's working! |
Haroenv
pushed a commit
to algolia/instantsearch
that referenced
this pull request
Nov 24, 2022
…ntsearch-e2e-tests#15) * fix(setSearchBoxValue): reset searchbox before editing In React and Preact the CLEAR selenium instruction does not fire any event, and therefore does not update the component's internal state (see this job for example: https://app.saucelabs.com/tests/4518f96fdfd447e998786d0ff463658a#54) It is equivalent to `input.value = ''`. There are multiple sources reporting a similar behaviour (see SeleniumHQ/selenium#6741) Since this change: #4202 ```jsx <input value={state.query} /> ``` instead of ```jsx <input value={props.query} /> ``` Since binding the input value to a `state.query` (rather than a `props.query`), it appears the click we use to focus on the searchbox re-syncs `input.value` with `state.query`.
Haroenv
pushed a commit
to algolia/instantsearch
that referenced
this pull request
Nov 24, 2022
…ntsearch-e2e-tests#15) * fix(setSearchBoxValue): reset searchbox before editing In React and Preact the CLEAR selenium instruction does not fire any event, and therefore does not update the component's internal state (see this job for example: https://app.saucelabs.com/tests/4518f96fdfd447e998786d0ff463658a#54) It is equivalent to `input.value = ''`. There are multiple sources reporting a similar behaviour (see SeleniumHQ/selenium#6741) Since this change: #4202 ```jsx <input value={state.query} /> ``` instead of ```jsx <input value={props.query} /> ``` Since binding the input value to a `state.query` (rather than a `props.query`), it appears the click we use to focus on the searchbox re-syncs `input.value` with `state.query`.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In React and Preact the CLEAR selenium instruction does not fire any event, and therefore does not update the component's internal state (see this job for example: https://app.saucelabs.com/tests/4518f96fdfd447e998786d0ff463658a#54)
It is equivalent to
input.value = ''
.There are multiple sources reporting a similar behaviour (see SeleniumHQ/selenium#6741)
Since this change: algolia/instantsearch#4202
instead of
Since binding the input value to a
state.query
(rather than aprops.query
), it appears the click we use to focus on the searchbox re-syncsinput.value
withstate.query
.Demonstration of the issue: