Skip to content

V4 dev backports and updates #31176

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

Merged
merged 7 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ module.exports = {
'@babel/preset-env',
{
loose: true,
modules: false,
exclude: ['transform-typeof-symbol']
bugfixes: true,
modules: false
}
]
],
plugins: [
'@babel/plugin-proposal-object-rest-spread'
],
env: {
test: {
plugins: [ 'istanbul' ]
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

group :development, :test do
gem 'jekyll', '~> 4.1.0'
gem 'jekyll', '~> 4.1.1'
gem 'jekyll-redirect-from', '~> 0.16.0'
gem 'jekyll-sitemap', '~> 1.4.0'
gem 'jekyll-toc', '~> 0.14.0'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GEM
http_parser.rb (0.6.0)
i18n (1.8.3)
concurrent-ruby (~> 1.0)
jekyll (4.1.0)
jekyll (4.1.1)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -42,7 +42,7 @@ GEM
nokogiri (~> 1.10)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.2.1)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
Expand Down Expand Up @@ -79,7 +79,7 @@ PLATFORMS
x64-mingw32

DEPENDENCIES
jekyll (~> 4.1.0)
jekyll (~> 4.1.1)
jekyll-redirect-from (~> 0.16.0)
jekyll-sitemap (~> 1.4.0)
jekyll-toc (~> 0.14.0)
Expand Down
15 changes: 14 additions & 1 deletion js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,25 @@ class Modal {
return
}

const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight

if (!isModalOverflowing) {
this._element.style.overflowY = 'hidden'
}

this._element.classList.add(CLASS_NAME_STATIC)

const modalTransitionDuration = Util.getTransitionDurationFromElement(this._element)
const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog)
$(this._element).off(Util.TRANSITION_END)

$(this._element).one(Util.TRANSITION_END, () => {
this._element.classList.remove(CLASS_NAME_STATIC)
if (!isModalOverflowing) {
$(this._element).one(Util.TRANSITION_END, () => {
this._element.style.overflowY = ''
})
.emulateTransitionEnd(this._element, modalTransitionDuration)
}
})
.emulateTransitionEnd(modalTransitionDuration)
this._element.focus()
Expand Down
2 changes: 1 addition & 1 deletion js/tests/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const browsers = {
os: 'Windows',
os_version: '10',
browser: 'Edge',
browser_version: 'latest'
browser_version: '15'
},
ie11Win10: {
base: 'BrowserStack',
Expand Down
17 changes: 17 additions & 0 deletions js/tests/unit/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,4 +959,21 @@ $(function () {
keyboard: false
})
})

QUnit.test('should not overflow when clicking outside of modal-content if backdrop = static', function (assert) {
assert.expect(1)
var done = assert.async()
var $modal = $('<div class="modal" data-backdrop="static"><div class="modal-dialog" style="transition-duration: 20ms;"/></div>').appendTo('#qunit-fixture')

$modal.on('shown.bs.modal', function () {
$modal.trigger('click')
setTimeout(function () {
assert.strictEqual($modal[0].clientHeight, $modal[0].scrollHeight)
done()
}, 20)
})
.bootstrapModal({
backdrop: 'static'
})
})
})
Loading