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(configure): pass the latest state to onStateChange #4555
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit da45143:
|
import { createSearchClient } from '../../../test/mock/createSearchClient'; | ||
|
||
describe('InstantSearch integration', () => { | ||
it('renders', () => { |
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.
test name should be about configure & onStateChange
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.
oops, it was a temporary name. will fix it
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.
You don't seem to have changed anything related to search state, how does this fix work? |
// Update original `widgetParams.searchParameters` to the new refined one | ||
widgetParams.searchParameters = searchParameters; | ||
|
||
// Trigger a search with the resolved search parameters | ||
helper.setState(nextSearchParameters).search(); |
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.
Nice fix! |
Summary
This PR fixes the bug
configure
connector didn't pass the latest state toonStateChange
whenrefine
happened from it.fixes #4421
Result
onStateChange
receives the latest state. It's addressed in the integration test.