-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(searchbox): fix usage of custom reset template #2585
Conversation
Deploy preview ready! Built with commit dedbcb7 https://deploy-preview-2585--algolia-instantsearch.netlify.com |
Doesn't seem like you changed any test, but I think it was testing the block / none styling: https://travis-ci.org/algolia/instantsearch.js/builds/304400146#L917-L935 |
Oops fixing that :) |
@@ -243,7 +245,7 @@ describe('searchBox()', () => { | |||
simulateInputEvent('test', 'tes', widget, helper, state, container); | |||
|
|||
// When | |||
$('button[type="reset"]')[0].click(); | |||
$('.ais-search-box--reset-wrapper')[0].click(); |
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.
the button is still type reset right? Not sure from this change
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.
yes. The problem is that it is in the template, so we cannot rely on what's inside it for the tests.
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.
This was the source of the bug. If you were to use an emoji, there would not be a button (with type=reset) so instead the event listener is on the outer span.
@@ -10,6 +10,7 @@ | |||
"scripts": { | |||
"build": "./scripts/build.sh", | |||
"dev": "./scripts/dev.sh", | |||
"dev-novel": "NODE_ENV=development webpack-dev-server --config dev/webpack.config.js", |
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.
We could probably reuse this command from the dev.sh
script.
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.
What do you mean? This line was extracted from dev.sh
.
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.
I mean in the dev.sh
we can do yarn dev-novel
instead of having the same command in two different places.
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.
That's not a big improvement though. Let's iterate on that later.
fix #2528. If we were to fix that completely we'd probably change the options to make them more consistent with the rest of the library and we'd fix the markup.
What this does: