[Modal] Vertically centered modal cutoff on mobile
See original GitHub issue🐛 Bug report
On mobile devices vertically centered modals get cutoff at the top. This happens for modals that are bigger than the screen.
💥 Steps to reproduce
Open a modal on mobile that is vertically centered and higher than the screen.
💻 Link to reproduction
https://chakra-ui.com/docs/overlay/modal
🧭 Possible Solution
I believe this is not solvable with the current structure. I could fix it with making the modal container display: block;
and adding one div element between the container and the modal content with min-height: 100%; display: flex; align-items: center; justify-content: center;
.
This needs to be tested for other modal types.
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | v1.0.3 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Bootstrap modal's top gets cut off when the modal content ...
I have a bootstrap modal which is vertically centered. But when the modal content increases in size, the top gets cut off.
Read more >Considerations for Styling a Modal | CSS-Tricks
Plus, the transforms-centering technique is more than happy to cut off the top of the modal with no scrollbar to save you:.
Read more >Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >How to make popup modal scrollable on smaller screens
I have a popup modal that is 800 pixels in height. When I view on mobile I can't scroll to the bottom. Not...
Read more >Bootstrap Modal Center Align Vertically and Horizontally ...
frontendfunn Bootstrap Modal Window align vertically and HorizontallyThanks For Watching.hope you enjoyed this video. Please do watch other ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this issue should be fixed. I’m currently using margin=“auto” on modal content block as a workaround. @segunadebayo
Following my explanation in the PR.