mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 16:14:04 +02:00
Fires change event when element is selected from menu
This commit is contained in:
6
js/tests/unit/bootstrap-typeahead.js
vendored
6
js/tests/unit/bootstrap-typeahead.js
vendored
@@ -114,15 +114,19 @@ $(function () {
|
||||
source: ['aa', 'ab', 'ac']
|
||||
})
|
||||
, typeahead = $input.data('typeahead')
|
||||
, changed = false
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
$input.change(function() { changed = true });
|
||||
|
||||
$(typeahead.$menu.find('li')[2]).mouseover().click()
|
||||
|
||||
equals($input.val(), 'ac', 'input value was correctly set')
|
||||
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
|
||||
ok(changed, 'a change event was fired')
|
||||
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user