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

Clicking table checkbox scrolls everything out of viewport #9403

Closed
1 of 2 tasks
wkeese opened this issue Aug 3, 2021 · 0 comments · Fixed by #9418
Closed
1 of 2 tasks

Clicking table checkbox scrolls everything out of viewport #9403

wkeese opened this issue Aug 3, 2021 · 0 comments · Fixed by #9418
Assignees

Comments

@wkeese
Copy link
Contributor

wkeese commented Aug 3, 2021

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

If a carbon table is contained in a scrollable <div>, then clicking the checkbox on chrome may scroll everything out of view.
Clicking a checkbox should not cause any scrolling.

Tested on Carbon 10.40.

I suspect there's a similar problem with vanilla checkboxes, which could be solved with a position:relative on the bx--checkbox-wrapper.

Steps to reproduce the issue

  1. Open https://codesandbox.io/s/adoring-sound-cvryv?file=/index.html
  2. Scroll down to the table.
  3. Click the checkbox.
  4. Everything scrolls out of the viewport.

Additional information

I originally filed this as https://bugs.chromium.org/p/chromium/issues/detail?id=1235323 but it seems to be a carbon issue, rather than a chrome issue per see. The root issue is that the checkbox's <input> is outside of the viewport, causing a scroll when clicking the <label>.

It only happens when the scroll is on a <div> rather than on the document itself.

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

Successfully merging a pull request may close this issue.

2 participants