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

Modal and offcanvas page content jumping vertically #39972

Open
3 tasks done
zigazuzek opened this issue May 8, 2024 · 2 comments
Open
3 tasks done

Modal and offcanvas page content jumping vertically #39972

zigazuzek opened this issue May 8, 2024 · 2 comments

Comments

@zigazuzek
Copy link
Sponsor

zigazuzek commented May 8, 2024

Prerequisites

Describe the issue

Page content is jumping vertically when using Boostrap 5 offcanvas and modal components.

Please watch the video to see the issue in question: https://app.screencastify.com/v3/watch/eEgOFiBe7LaCQA7la1eg

This happens:

  • with browsers having a non floating scrollbar (like Chrome and Edge)
  • when the container width is 100% and the scrollbar is touching the content (usually a smaller browser size)

Any potential fix or a workaround would be welcome. I can think of two workarounds so far, but that doesn't fix the core of the problem:

  • enabling scrolling on modals and offcanvas
  • using multiple container widths, so just .container instead of .container-xxl for example

Reduced test cases

You can test it in the Boostrap docs https://getbootstrap.com/docs/5.3/components/modal/#how-it-works

Make sure to test it with a smaller browser window, so the container is 100%.

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

Windows, macOS

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

Chrome, Microsoft Edge

What version of Bootstrap are you using?

v5.3.3

@marwenbenhajhassine
Copy link

A common approach is to add some custom CSS that prevents the body from shifting when the modal or offcanvas component is opened

@zigazuzek
Copy link
Sponsor Author

A common approach is to add some custom CSS that prevents the body from shifting when the modal or offcanvas component is opened

Hi, everything I've tried so far didn't fix the issue. Did you have any particular CSS fix in mind?

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

No branches or pull requests

2 participants