-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Scrollable modal #27769
Scrollable modal #27769
Conversation
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.
Can you add a unit test please ?
Otherwise LGTM 👍
I'm not very familiar with QUnit. I'd like to ask your support 🙏 |
@ysds you have to check when you a modal is shown, if this modal has |
42330be
to
6b81006
Compare
@ysds, you'll need to add a test to this file: https://github.com/twbs/bootstrap/blob/v4-dev/js/tests/unit/modal.js |
I wonder if the scrollable content should be default behaviour on vertically centered modals? |
@Johann-S I think that test result will always be OK, because the initial scrollTop of a modal body is 0. After creating a modal that overflows the height of the viewport, then it is necessary to change the scroll potion. How can I define a modal that overflows the height of the viewport? What is the height of the viewport in the test? (I have never written a Qunit test script) |
@ysds it seems not see: https://coveralls.io/builds/20490418/source?filename=js/src/modal.js#L251 You have to create a modal with a height greater than |
Done. I had some misunderstanding. It seems there was no need to get the viewport height. |
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.
The css LGTM
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.
LGTM 👍
Rebased. |
3d7048e
to
9875fba
Compare
@mdo: Is there something else we need here or can we merge? |
Please wait to merge! I found a better workaround for the strange scrollbar behavior on IE. |
I changed the |
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.
Excited for this! Thank you <3.
Introduces the new modal feature behind twbs/bootstrap#27769. Setting the option `scrollable: true` will add the corresponding bootstrap class `.modal-dialog-scrollable`
Introduces the new modal feature behind twbs/bootstrap#27769. Setting the option `scrollable: true` will add the corresponding bootstrap class `.modal-dialog-scrollable`
Introduces the new modal feature behind twbs/bootstrap#27769. Setting the option `scrollable: true` will add the corresponding bootstrap class `.modal-dialog-scrollable`
This feature is inspired by MDC Dialog.
The scrollable modal allows scrolling the modal body. The standard model height fits to own content height, but the scrollable modal fits within the viewport height if the content is too long.
demo: https://deploy-preview-27769--twbs-bootstrap4.netlify.com/docs/4.2/components/modal/#scrolling-long-content
Cheers!