Skip to content
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(refresh): remain current value of isOpen #334

Merged
merged 1 commit into from Oct 9, 2020
Merged

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Oct 8, 2020

Summary

For now, autocompleteInstance.refresh() always open the dropdown no matter if it was already closed or not.
This PR fixes the bug so that it can remain closed if it was.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 8, 2020

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 77560d2:

Sandbox Source
algolia/autocomplete.js: js Configuration

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -58,6 +58,9 @@ export function createAutocomplete<
setIsOpen,
setStatus,
setContext,
nextState: {
isOpen: store.getState().isOpen,
Copy link
Contributor

Choose a reason for hiding this comment

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

is there other values of state that should be kept?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't found any yet.
I'll send a new PR when I find something.

@eunjae-lee eunjae-lee merged commit 637d23e into next Oct 9, 2020
@eunjae-lee eunjae-lee deleted the fix/refresh branch October 9, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants