Completing a tab cycle inside a bootstrap modal will cause the page to scroll
aashish-aenow opened this issue · comments
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
When you tab through an open modal, one complete cycle so that the focus goes from the last element on the modal back to the X [close] button, it causes the page to scroll where ever the modal is in the DOM order. This behavior is present in the current bootstrap site as well.
Steps to Reproduce
- Add a modal on your page
- Toggle the modal and tab through the modal one full cycle until you focus back on the X [close] button.
- Move the modal to a different part of the page DOM and repeat step 1 and 2
Reduced test cases
https://getbootstrap.com/docs/5.3/components/modal/#live-demo
Scroll slightly so the "Launch Modal" button is slightly off screen but still clickable or scroll up so the button is almost at the bottom of the page and toggle the modal and tab through the modal
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome, Firefox, Microsoft Edge
What version of Bootstrap are you using?
v5.3.3