Bug: Layout shift when closing modals on small screens
KevinMulhern opened this issue · comments
Kevin commented
Checks
- I have thoroughly read and understand The Odin Project Contributing Guide
- The title of this issue follows the
Bug: brief description of bug
format, e.g.Bug: Lesson complete button does not update on click
- Would you like to work on this issue?
Bug description
When opening modals, we lock scrolling on the screen and hide the scrollbar.
This works fine on larger screens. But the scroll bar is already hidden on mobiles (unless you are actively scrolling).
This is creating a layout shift when a modal is closed, demonstrated in this video:
Screen.Recording.2024-04-07.at.19.28.39.mov
How to reproduce
- Sign in
- Upload a solution for one of the projects
- Visit your dashboard
- Open mobile / responsive design view from your dev tools
- Click edit on the solution you uploaded
- Close the modal
- 💥 the layout shifts
Expected behavior
- Sign in
- Upload a solution for one of the projects
- Visit your dashboard
- Open mobile / responsive design view from your dev tools
- Click edit on the solution you uploaded
- Close the modal
- The layout does not shift
What browsers are you seeing the problem on?
Chrome
What OS are you using?
MacOS
Discord Name
Additional Comments
We hide the the scrollbar by applying a Tailwind p-4
utility class to the document body here:
This likely only needs to be applied to screens above Tailwinds sm
breakpoint. So changing to sm:p-4
might fix it.
Bryan Fines commented
May I be assigned.