Skip to content

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-commenter commented Mar 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dc9da74) to head (e5a949c).
⚠️ Report is 16 commits behind head on master.
❗ 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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
@silviuaavram
Copy link
Collaborator

silviuaavram commented Mar 1, 2024

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

@github-actions
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