Commit 5830febd authored by Jacob's avatar Jacob
Browse files

Merge pull request #13855 from hnrch02/modal-mousedown

Use mousedown instead of click for backdrop click detection; fixes #13816
parents fc29dfab 121bf663
4 merge requests!28721Hot test,!16605Test pull please ignore,!22103test,!25326Adjust examples
Showing with 3 additions and 3 deletions
+3 -3
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(this.$body) .appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { this.$element.on('mousedown.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return if (e.target !== e.currentTarget) return
this.options.backdrop == 'static' this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0]) ? this.$element[0].focus.call(this.$element[0])
......
...@@ -154,7 +154,7 @@ $(function () { ...@@ -154,7 +154,7 @@ $(function () {
ok($('#modal-test').length, 'modal insterted into dom') ok($('#modal-test').length, 'modal insterted into dom')
$('.contents').click() $('.contents').click()
ok($('#modal-test').is(':visible'), 'modal visible') ok($('#modal-test').is(':visible'), 'modal visible')
$('#modal-test').click() $('#modal-test').mousedown()
}) })
.on('hidden.bs.modal', function () { .on('hidden.bs.modal', function () {
ok(!$('#modal-test').is(':visible'), 'modal hidden') ok(!$('#modal-test').is(':visible'), 'modal hidden')
...@@ -212,7 +212,7 @@ $(function () { ...@@ -212,7 +212,7 @@ $(function () {
div div
.on('shown.bs.modal', function () { .on('shown.bs.modal', function () {
triggered = 0 triggered = 0
$('#modal-test').click() $('#modal-test').mousedown()
}) })
.on('hide.bs.modal', function () { .on('hide.bs.modal', function () {
triggered += 1 triggered += 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment