1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 16:50:00 +02:00

Dropdown - Allow to disable Popper.js style (#24092)

* Dropdown - Allow to disable Popper.js style

* Update dropdown.js

* Update dropdown.html

* copy changes
This commit is contained in:
Johann-S
2018-02-12 01:45:59 +01:00
committed by Mark Otto
parent ba878eb542
commit 65ae622d40
4 changed files with 61 additions and 5 deletions

View File

@@ -908,4 +908,34 @@ $(function () {
})
$textarea.trigger('click')
})
QUnit.test('should not use Popper.js if display set to static', function (assert) {
assert.expect(1)
var dropdownHTML =
'<div class="dropdown">' +
'<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-display="static">Dropdown</a>' +
'<div class="dropdown-menu">' +
'<a class="dropdown-item" href="#">Secondary link</a>' +
'<a class="dropdown-item" href="#">Something else here</a>' +
'<div class="divider"/>' +
'<a class="dropdown-item" href="#">Another link</a>' +
'</div>' +
'</div>'
var $dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.bootstrapDropdown()
var done = assert.async()
var dropdownMenu = $dropdown.next()[0]
$dropdown.parent('.dropdown')
.on('shown.bs.dropdown', function () {
// Popper.js add this attribute when we use it
assert.strictEqual(dropdownMenu.getAttribute('x-placement'), null)
done()
})
$dropdown.trigger('click')
})
})