Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9181e4b1
Commit
9181e4b1
authored
May 24, 2019
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix search dropdown not closing on blur if empty
parent
12aff0b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+1
-1
app/views/layouts/_search.html.haml
app/views/layouts/_search.html.haml
+1
-1
changelogs/unreleased/fix-search-dropdown-blur-close.yml
changelogs/unreleased/fix-search-dropdown-blur-close.yml
+5
-0
spec/features/global_search_spec.rb
spec/features/global_search_spec.rb
+14
-0
No files found.
app/assets/javascripts/search_autocomplete.js
View file @
9181e4b1
...
@@ -405,7 +405,7 @@ export class SearchAutocomplete {
...
@@ -405,7 +405,7 @@ export class SearchAutocomplete {
this
.
wrap
.
removeClass
(
'
search-active
'
);
this
.
wrap
.
removeClass
(
'
search-active
'
);
// If input is blank then restore state
// If input is blank then restore state
if
(
this
.
searchInput
.
val
()
===
''
)
{
if
(
this
.
searchInput
.
val
()
===
''
)
{
return
this
.
restoreOriginalState
();
this
.
restoreOriginalState
();
}
}
this
.
dropdownMenu
.
removeClass
(
'
show
'
);
this
.
dropdownMenu
.
removeClass
(
'
show
'
);
}
}
...
...
app/views/layouts/_search.html.haml
View file @
9181e4b1
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
mr_path:
merge_requests_dashboard_path
},
mr_path:
merge_requests_dashboard_path
},
aria:
{
label:
_
(
'Search or jump to…'
)
}
aria:
{
label:
_
(
'Search or jump to…'
)
}
%button
.hidden.js-dropdown-search-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%button
.hidden.js-dropdown-search-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
.dropdown-menu.dropdown-select
.dropdown-menu.dropdown-select
.js-dashboard-search-options
=
dropdown_content
do
=
dropdown_content
do
%ul
%ul
%li
.dropdown-menu-empty-item
%li
.dropdown-menu-empty-item
...
...
changelogs/unreleased/fix-search-dropdown-blur-close.yml
0 → 100644
View file @
9181e4b1
---
title
:
Fix search dropdown not closing on blur if empty
merge_request
:
28730
author
:
type
:
fixed
spec/features/global_search_spec.rb
View file @
9181e4b1
...
@@ -25,4 +25,18 @@ describe 'Global search' do
...
@@ -25,4 +25,18 @@ describe 'Global search' do
expect
(
page
).
to
have_selector
(
'.gl-pagination .next'
)
expect
(
page
).
to
have_selector
(
'.gl-pagination .next'
)
end
end
end
end
it
'closes the dropdown on blur'
,
:js
do
visit
dashboard_projects_path
fill_in
'search'
,
with:
"a"
dropdown
=
find
(
'.js-dashboard-search-options'
)
expect
(
dropdown
[
:class
]).
to
include
'show'
find
(
'#search'
).
send_keys
(
:backspace
)
find
(
'body'
).
click
expect
(
dropdown
[
:class
]).
not_to
include
'show'
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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