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

Radio button group: needs relative positioning when used inside a scrolling element #8932

Closed
1 of 2 tasks
Tracked by #8870
matthewgallo opened this issue Jun 16, 2021 · 0 comments · Fixed by #8933
Closed
1 of 2 tasks
Tracked by #8870

Comments

@matthewgallo
Copy link
Member

matthewgallo commented Jun 16, 2021

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you're having.
When using the RadioButtonGroup and RadioButton components together in an element that has scrolling content, the input element from the RadioButton gets positioned absolutely based on some containing element that is not the radio button wrapper. This behavior causes an additional scrollbar to unintentionally show and causes layout issues.

Is this issue related to a specific component?
Yes
RadioButtonGroup
RadioButton
What did you expect to happen? What happened instead? What would you like to
see changed?
I expected that .bx--radio-button-wrapper should have position: relative;. Adding the relative positioning to .bx--radio-button-wrapper fixes this issue.
What browser are you working in?
Chrome
What version of the Carbon Design System are you using?
carbon-components-react: 7.37.0
carbon-components: 10.37.0

Steps to reproduce the issue

  1. Have a scrolling element with radio button group and radio buttons inside of it
  2. Toggle between radio buttons
  3. At this point, there should be an extra scroll bar that has appeared because of the position of the input element from the RadioButton

Please create a reduced test case in CodeSandbox
https://codesandbox.io/s/carbon-radio-button-position-bug-b0g29?file=/src/App.js

Additional information

  • Screenshots or code
    See extra scrollbar because of positioning of input element from RadioButton
    Screen Shot 2021-06-16 at 12 30 14 PM
    Adding position: relative; to .bx--radio-button-group fixes issue
    Screen Shot 2021-06-16 at 12 31 02 PM
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