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(concurrency): ensure panel stays closed after blur (patch) #831

Conversation

francoischalifour
Copy link
Member

@francoischalifour francoischalifour commented Dec 3, 2021

This is a proposed patch on top of #829.

See #829 (review).

I did it very quickly so we can rename things later.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 3, 2021

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 3963667:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
algolia/autocomplete Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
algolia/autocomplete Configuration
algolia/autocomplete Configuration
@algolia/autocomplete-example-vue Configuration

Copy link
Member

@sarahdayan sarahdayan left a comment

Choose a reason for hiding this comment

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

Good solution, much more straightforward 👍

Comment on lines 46 to 48
nextStateRef = nextState;
propsRef = props;
queryRef = query;
Copy link
Member

Choose a reason for hiding this comment

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

Why delete those? When you're not in a shouldSkipSearch situation, you'd need those because you're not guaranteed to have the last called onInput resolve last.

Copy link
Member Author

Choose a reason for hiding this comment

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

I relied on the tests for the implementation and this doesn't seem to be covered then. We can add it back and test it.

Copy link
Member

Choose a reason for hiding this comment

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

Yes let's test it in the base PR.

@sarahdayan sarahdayan force-pushed the fix/late-promises-on-submit-skipSearch-patch branch from 8311351 to 3963667 Compare December 6, 2021 17:40
@sarahdayan sarahdayan merged commit d5f903a into fix/late-promises-on-submit Dec 6, 2021
@sarahdayan sarahdayan deleted the fix/late-promises-on-submit-skipSearch-patch branch December 6, 2021 18:00
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.

2 participants