mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Merge branch 'marcelkorpel-master' into 2.3.0-wip
This commit is contained in:
commit
5da30ee5fb
2 changed files with 6 additions and 0 deletions
1
js/bootstrap-typeahead.js
vendored
1
js/bootstrap-typeahead.js
vendored
|
@ -271,6 +271,7 @@
|
|||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
this.select()
|
||||
this.$element.focus()
|
||||
}
|
||||
|
||||
, mouseenter: function (e) {
|
||||
|
|
5
js/tests/unit/bootstrap-typeahead.js
vendored
5
js/tests/unit/bootstrap-typeahead.js
vendored
|
@ -192,17 +192,22 @@ $(function () {
|
|||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
, changed = false
|
||||
, focus = false
|
||||
, blur = false
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
$input.change(function() { changed = true });
|
||||
$input.focus(function() { focus = true; blur = false });
|
||||
$input.blur(function() { blur = true; focus = false });
|
||||
|
||||
$(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')
|
||||
ok(focus && !blur, 'focus is still set')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
|
|
Loading…
Reference in a new issue