Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
6ec7c72e
Commit
6ec7c72e
authored
12 years ago
by
Paul McLanahan
Browse files
Options
Download
Email Patches
Plain Diff
Fix issue with double move event firing in typeahead.
Fix test to catch issue. Fix
#5806
.
parent
54486de8
1 merge request
!5862
Fix issue with double move event firing in typeahead.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/bootstrap-typeahead.js
+1
-1
js/bootstrap-typeahead.js
js/tests/unit/bootstrap-typeahead.js
+18
-1
js/tests/unit/bootstrap-typeahead.js
with
19 additions
and
2 deletions
+19
-2
js/bootstrap-typeahead.js
+
1
-
1
View file @
6ec7c72e
...
...
@@ -217,7 +217,7 @@
}
,
keydown
:
function
(
e
)
{
this
.
suppressKeyPressRepeat
=
!
~
$
.
inArray
(
e
.
keyCode
,
[
40
,
38
,
9
,
13
,
27
])
this
.
suppressKeyPressRepeat
=
~
$
.
inArray
(
e
.
keyCode
,
[
40
,
38
,
9
,
13
,
27
])
this
.
move
(
e
)
}
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-typeahead.js
+
18
-
1
View file @
6ec7c72e
...
...
@@ -137,10 +137,19 @@ $(function () {
equals
(
typeahead
.
$menu
.
find
(
'
.active
'
).
length
,
1
,
'
one item is active
'
)
ok
(
typeahead
.
$menu
.
find
(
'
li
'
).
first
().
hasClass
(
'
active
'
),
"
first item is active
"
)
// simulate entire key pressing event
$input
.
trigger
({
type
:
'
keydown
'
,
keyCode
:
40
})
.
trigger
({
type
:
'
keypress
'
,
keyCode
:
40
})
.
trigger
({
type
:
'
keyup
'
,
keyCode
:
40
})
ok
(
typeahead
.
$menu
.
find
(
'
li
'
).
first
().
next
().
hasClass
(
'
active
'
),
"
second item is active
"
)
...
...
@@ -149,6 +158,14 @@ $(function () {
type
:
'
keydown
'
,
keyCode
:
38
})
.
trigger
({
type
:
'
keypress
'
,
keyCode
:
38
})
.
trigger
({
type
:
'
keyup
'
,
keyCode
:
38
})
ok
(
typeahead
.
$menu
.
find
(
'
li
'
).
first
().
hasClass
(
'
active
'
),
"
first item is active
"
)
...
...
@@ -196,4 +213,4 @@ $(function () {
typeahead
.
$menu
.
remove
()
})
})
\ No newline at end of file
})
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets