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

Checkbox focus state is cut off when inside a container with an overflow #6480

Closed
jendowns opened this issue Jul 16, 2020 · 2 comments · Fixed by #7620 or #7887
Closed

Checkbox focus state is cut off when inside a container with an overflow #6480

jendowns opened this issue Jul 16, 2020 · 2 comments · Fixed by #7620 or #7887

Comments

@jendowns
Copy link
Contributor

Detailed description

Whenever the Checkbox component sits inside a container with a non-default/initial overflow value (like overflow: auto or overflow: hidden, its focus outline is cut off at the edge of the container.

This is likely because the focus outline uses box-shadow & is not currently accommodating for the extra space needed.

Screenshots:

With overflow Without overflow
Screen Shot 2020-07-16 at 8 52 11 AM Screen Shot 2020-07-16 at 8 52 22 AM

Steps to reproduce the issue

  1. Go to the storybook: https://carbon-components-react.netlify.app/?path=/story/checkbox--checked
  2. Inspect Checkbox and find the wrapping <fieldset> element
  3. In the browser inspector, change the <fieldset> to overflow: auto or overflow: hidden
  4. Focus on a Checkbox to see the focus "outline" (i.e., box-shadow) is cut off.
@jendowns
Copy link
Contributor Author

There are several approaches to fix this probably, but I do have a quick idea that involves added 2px to make up for the spacing needed for the box-shadow. I'll open a PR for that proposal momentarily 👍

@emyarod
Copy link
Member

emyarod commented Feb 24, 2021

this issue is unresolved

image

https://codesandbox.io/s/spring-night-tnvxu?file=/index.js

ref #7620
related #7113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment