mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-15 15:29:22 +01:00
Harmonize document.activeElement comparison
This commit is contained in:
parent
4448ca057b
commit
ef2181ff4d
@ -532,13 +532,13 @@ $(function () {
|
|||||||
.on('shown.bs.dropdown', function () {
|
.on('shown.bs.dropdown', function () {
|
||||||
assert.ok(true, 'shown was fired')
|
assert.ok(true, 'shown was fired')
|
||||||
$dropdown.trigger($.Event('keydown', { which: 40 }))
|
$dropdown.trigger($.Event('keydown', { which: 40 }))
|
||||||
assert.ok($(document.activeElement)[0] === $('#item1')[0], 'item1 is focused')
|
assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused')
|
||||||
|
|
||||||
$(document.activeElement).trigger($.Event('keydown', { which: 40 }))
|
$(document.activeElement).trigger($.Event('keydown', { which: 40 }))
|
||||||
assert.ok($(document.activeElement)[0] === $('#item2')[0], 'item2 is focused')
|
assert.ok($(document.activeElement).is($('#item2')), 'item2 is focused')
|
||||||
|
|
||||||
$(document.activeElement).trigger($.Event('keydown', { which: 38 }))
|
$(document.activeElement).trigger($.Event('keydown', { which: 38 }))
|
||||||
assert.ok($(document.activeElement)[0] === $('#item1')[0], 'item1 is focused')
|
assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused')
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
$dropdown.trigger('click')
|
$dropdown.trigger('click')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user