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: fixes issue causing combobox to grab focus on render #1575

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

FredrikMWold
Copy link
Contributor

What: fixes issue causing combobox to grab focus on render

Why: Closes: #1574

How: The latest release adds isInitalMount to the dependency array. Whichs causes it to rerender when isInitialMount is set to false and triggering .focus.

Checklist:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (dc9da74) to head (e5a949c).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1575   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1746      1746           
  Branches       528       528           
=========================================
  Hits          1746      1746           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FredrikMWold
Copy link
Contributor Author

Would say this is the simplest solution. Another way if you dont want to disable eslint for that line is to change the useIsIninitalMount to return the ref instead of the current value. Then it would be a stable reference in the dependency array.

@silviuaavram
Copy link
Collaborator

Let's keep it like that, for now. Thanks!

@silviuaavram silviuaavram merged commit 59366d9 into downshift-js:master Mar 1, 2024
2 checks passed
@silviuaavram
Copy link
Collaborator

silviuaavram commented Mar 1, 2024

@all-contributors please add @FredrikMWold for code, bug

Copy link

github-actions bot commented Mar 1, 2024

🎉 This PR is included in version 8.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useComboBox always grabbing focus on render
3 participants