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 re-focus of component in Firefox if being disabled while focused #5246

Merged
merged 4 commits into from Oct 24, 2022

Conversation

Rall3n
Copy link
Collaborator

@Rall3n Rall3n commented Jun 27, 2022

Fixes #4906.

As explained in #4906 (comment), Firefox does not fire blur if component becomes disabled while focused.

When re-enabling, Firefox by default re-focuses the component without firing the focus event, causing in the focused state not being properly set.

This PR fixes this behavior by setting isFocused state if component was previously disabled and if inputRef is currently active element.

@changeset-bot
Copy link

changeset-bot bot commented Jun 27, 2022

🦋 Changeset detected

Latest commit: cb6393d

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

This PR includes changesets to release 1 package
Name Type
react-select 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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 27, 2022

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

Sandbox Source
react-codesandboxer-example Configuration
fragrant-worker-gxr5yq Issue #4906

@Rall3n Rall3n changed the title Fix firefox refocus Fix re-focus of component in Firefox if being disabled while focused Jun 27, 2022
Copy link

@aesy aesy left a comment

Choose a reason for hiding this comment

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

LGTM, I can confirm that this fixes the issue in Firefox 👍

@Rall3n Rall3n force-pushed the fix-firefox-refocus branch 2 times, most recently from 6ddc027 to 8a03600 Compare October 21, 2022 06:26
@lukebennett88 lukebennett88 added the pr/bug-fix PRs that are specifically addressing a bug label Oct 21, 2022
@lukebennett88 lukebennett88 merged commit 6eb82d4 into JedWatson:master Oct 24, 2022
@github-actions github-actions bot mentioned this pull request Oct 24, 2022
@Rall3n Rall3n deleted the fix-firefox-refocus branch October 24, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/bug-fix PRs that are specifically addressing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueContainer loose click event after isDisabled state
3 participants