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
0dece7a7
Commit
0dece7a7
authored
12 years ago
by
Marcel Korpel
Browse files
Options
Download
Email Patches
Plain Diff
Set focus back to input field after clicking an item
Test 'focus is still set' added Fixes issue
#5933
parent
3b3dd3ac
4 merge requests
!6821
Typeahead updater
,
!6666
Patch 1
,
!6610
Add outline for input[type="image"]
,
!6099
Set focus back after clicking typeahead menu
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/bootstrap-typeahead.js
+1
-0
js/bootstrap-typeahead.js
js/tests/unit/bootstrap-typeahead.js
+5
-0
js/tests/unit/bootstrap-typeahead.js
with
6 additions
and
0 deletions
+6
-0
js/bootstrap-typeahead.js
+
1
-
0
View file @
0dece7a7
...
...
@@ -263,6 +263,7 @@
e
.
stopPropagation
()
e
.
preventDefault
()
this
.
select
()
this
.
$element
.
focus
()
}
,
mouseenter
:
function
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-typeahead.js
+
5
-
0
View file @
0dece7a7
...
...
@@ -162,17 +162,22 @@ $(function () {
})
,
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
'
)
typeahead
.
$menu
.
remove
()
})
...
...
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