twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.51k stars 78.84k forks source link

Radio Toggle Buttons in Accordion break scrolling #39514

Open shirkrm opened 10 months ago

shirkrm commented 10 months ago

Prerequisites

Describe the issue

An accordion with limited height and overflow-y-auto, and a body that extends beyond the window height and includes radio toggle buttons will show scrollbars on both the limited height div and the main window.

Expected: The scrollbar is shown only on the limited height div and not on the main body.

image

image

Reduced test cases

https://codepen.io/shirkrm/pen/YzgKeEy

accordion-radio-test.html.txt

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.3.2

github-actions[bot] commented 10 months ago

Hello @shirkrm. Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case on CodePen or StackBlitz and report back with your link, Bootstrap version, and specific browser and Operating System details.

shirkrm commented 10 months ago

https://codepen.io/shirkrm/pen/YzgKeEy

- -
Bootstrap Version 5.3.2
Browser Chrome
OS Windows
TommasoAllegretti commented 10 months ago

Your radio inputs appear to move lower when the first accordion is open causing the main body of the page to show a scrollbar when showing the elements of both accordions.

Setting the desired position of those elements should solve the issue. You can test this by applying the following style to both input tags:

position: absolute;
left: 0;
top: 0;

Hope this is helpful for your case.