question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
krishnaacc123commented, Aug 24, 2022

I think this issue should be fixed. I’m currently using margin=“auto” on modal content block as a workaround. @segunadebayo

0reactions
segunadebayocommented, Mar 2, 2021

Following my explanation in the PR.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found