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

Improve initial useCombobox initialization process #2818

Merged
merged 3 commits into from
Jan 26, 2023
Merged

Conversation

iansan5653
Copy link
Contributor

The useCombobox hook can sometimes fail to properly initialize when the menu is open before the Combobox instance initializes. This is a race condition that appears in applications with synchronous suggestion data when the menu initially opens.

This fixes that problem by updating the effect in which the combobox is initialized to wait to try to initialize until after the instantiation completes.

Fix #2813

Merge checklist

  • [ ] Added/updated tests
  • This race condition unfortunately does not seem replicable in tests
  • [ ] Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@iansan5653 iansan5653 requested a review from a team January 26, 2023 18:08
@iansan5653 iansan5653 self-assigned this Jan 26, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2023

🦋 Changeset detected

Latest commit: 2416c97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 88.87 KB (-0.01% 🔽)
dist/browser.umd.js 89.48 KB (-0.01% 🔽)

@github-actions github-actions bot temporarily deployed to storybook-preview-2818 January 26, 2023 18:15 Inactive
@iansan5653 iansan5653 temporarily deployed to github-pages January 26, 2023 18:15 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2818 January 26, 2023 18:16 Inactive
@iansan5653 iansan5653 enabled auto-merge (squash) January 26, 2023 19:34
@joshblack joshblack temporarily deployed to github-pages January 26, 2023 19:53 — with GitHub Actions Inactive
@iansan5653 iansan5653 merged commit 7403a47 into main Jan 26, 2023
@iansan5653 iansan5653 deleted the fix-suggestions branch January 26, 2023 19:57
@primer-css primer-css mentioned this pull request Jan 26, 2023
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.

Synchronous InlineAutocomplete suggestions don't work when there isn't any text after the trigger character
2 participants