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 checkbox scrolls page title out of view #9444

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

Clicking checkbox scrolls page title out of view #9444

wkeese opened this issue Aug 10, 2021 · 0 comments · Fixed by #9892

Comments

@wkeese
Copy link
Contributor

wkeese commented Aug 10, 2021

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

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

Presumably similar to #9403, i.e. it has the same problem that the checkbox is missing a position: relative which makes the <input> position out of the viewport.

Tested on Carbon 10.41.

Steps to reproduce the issue

  1. Open https://codesandbox.io/s/focused-lamarr-tjfkq?file=/index.html
  2. Scroll down to the checkboxes, but not so far that the page title scrolls out of view.
  3. Click a checkbox.
  4. Page title 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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants