-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Update _modal.scss #30003
Update _modal.scss #30003
Conversation
1- Fix ".modal-dialog-centered" class in mobile browsers as its not exactly centered because the browser add the height of "::before" to the content. 2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.
Hi @Achmed4,
|
Please, Check this URL for video demo As you can see when you first open the modal its not centered vertically and also if you tried to drag its content it will move. This media query works only on IE and ::before styles are necessary for IE to center the modal. |
@ysds, I can recall you applied some magic to center the modals in IE, could you check out what's going on here? |
.modal { | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont remove these, because cause scrolling issue, see https://deploy-preview-30003--twbs-bootstrap.netlify.com/docs/4.3/components/modal/#scrolling-long-content and click the firse "Lanch demo modal".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can fix this by setting the code below on the "modal-body"
.modal-body { overflow-y: auto; max-height: 65vh; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can extend ".modal-dialog-scrollable" placeholder inside our modal-dialog by default. It won't affect anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modal scrolls entirely by default. There are no plans to change this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this behavior causes the issue in the video. and what about the vertical centering and IE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing L11-14 has nothing to do with the problem in your video.
2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.
It is a browser bug, see https://getbootstrap.com/docs/4.4/getting-started/browsers-devices/#overflow-and-scrolling
I found a solution without CSS hack. I'm going to create a new PR, please see it. So close this. |
1- Fix ".modal-dialog-centered" class in mobile browsers as its not exactly centered because the browser add the height of "::before" to the content.
2- Remove ".modal {overflow-x: hidden;overflow-y: auto;}" it makes the modal content scrollable in mobile browsers if you tried to drag it.