-
-
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
Modal: Fix backdrop not readjusting when height changes #15881
Conversation
How does this fix #15106 exactly? |
I thought |
…c content height Fixes twbs#15106 — Document how to properly handle modals with dynamic content height X-Ref: twbs#15881
To clarify: |
29a5135
to
21b4e24
Compare
@@ -167,7 +167,7 @@ $(function () { | |||
assert.notEqual($('#modal-test').length, 0, 'modal insterted into dom') | |||
$('.contents').click() | |||
assert.ok($('#modal-test').is(':visible'), 'modal visible') | |||
$('#modal-test .modal-backdrop').click() |
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.
Forgive my confusion, but why isn't this $('.modal-backdrop').click()
? Isn't clicking on the backdrop rather than the modal itself the whole point of this test?
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.
Well, you'll never click on the backdrop. The event listener for the click
event is on the modal element.
[Ref twbs#15881] Use Explicit Values for javascript variables rather than chained ones. From twbs#15881 (comment)
[Ref #15881] Use Explicit JS Variable Declarations rather than Chained
21b4e24
to
0a393d6
Compare
While #15910 did add a note about needing to call |
True, but since |
@@ -64,6 +66,28 @@ | |||
this.resize() | |||
|
|||
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) | |||
this.$element.on('show.bs.collapse hide.bs.collapse', function (e) { |
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.
i feel like this is making a bloated method, worse – can we move some of this logic into a handler
maybe like
this.$element.on('show.bs.collapse hide.bs.collapse', this.adjustDialogOnShowHide)
or some better name 👍
0a393d6
to
f5beebe
Compare
lgtm |
Modal: Fix backdrop not readjusting when height changes
@hnrch02 I think that's an oversight in and of itself. We don't intentionally make folks jump through the |
@cvrebert So you suggest we add |
Yeah. |
It is actually already accessible that way, we just need to document it. |
So when can we expect 3.3.4? |
Looks like the CSS changes here caused #16148. Are they necessary? |
so is there a fix for this & #16148 being worked on? |
@allspain "This" is a pull request, so it's not clear what problem you're referring to. |
@hnrch02 Can you answer mdo's question? |
Fixes #15136.
Closes #15345.
Closes #15314.
Refs #14724, #14927.
Effectively reverts #14724 but still fixes #13816. The backdrop will now again be appended to the body and not the
.modal
container.Also includes a workaround for when an opening accordion makes the modal overflow to minimize jumping on the dialog. (It's more of a proof of concept, I understand if we take it out before merging.)
/cc @cvrebert @fat @XhmikosR
Sorry it took so long guys.