Repository navigation
Scrollable modal - #27769
Scrollable modal#27769
Conversation
Johann-S
left a comment
There was a problem hiding this comment.
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. |
|
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 |
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!