diff --git a/js/src/modal.js b/js/src/modal.js index 5c2c0208aa..447e32acfe 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -489,7 +489,7 @@ const Modal = (($) => { const config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()) - if (this.tagName === 'A') { + if (this.tagName === 'A' || this.tagName === 'AREA') { event.preventDefault() } diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index cd3c96b9e5..7af5aeb272 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -454,4 +454,26 @@ $(function () { }) .bootstrapModal('show') }) + + QUnit.test('should not follow link in area tag', function (assert) { + assert.expect(2) + var done = assert.async() + + $('') + .appendTo('#qunit-fixture') + + $('