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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: focus issue in checkbox switch #6194

Merged

Conversation

anubra266
Copy link
Collaborator

Closes #4216

馃摑 Description

You cannot toggle a switch on a single click if you have text that is highlighted (selected) on the screen.

鉀筹笍 Current behavior (updates)

On mousedown, the input usually blurs and returns focus to the body, we do to prevent this

馃殌 New behavior

We only prevent the default event if the input is already focused

馃挘 Is this a breaking change (Yes/No): No

@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2022

馃 Changeset detected

Latest commit: dd621e4

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

This PR includes changesets to release 11 packages
Name Type
@chakra-ui/checkbox Patch
@chakra-ui/react Patch
@chakra-ui/switch Patch
create-react-app-ts Patch
gatsby-starter-default Patch
chakra-nextjs Patch
chakra-nextjs-ts Patch
@chakra-ui/props-docs Patch
@chakra-ui/storybook-addon Patch
@chakra-ui/test-utils Patch
storybook-addon 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

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

Sandbox Source
create-react-app-ts Configuration
wizardly-sea-f3bes2 Issue #4216

@segunadebayo segunadebayo merged commit f3c0040 into chakra-ui:main Jun 15, 2022
@segunadebayo segunadebayo changed the title Fix/focus issue in checkbox switch fix: focus issue in checkbox switch Jun 15, 2022
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.

Switch cannot toggle correctly when text is highlighted
2 participants