add focus to search when you click icon
This commit is contained in:
@@ -24,12 +24,13 @@
|
|||||||
vm.clearSearch = clearSearch;
|
vm.clearSearch = clearSearch;
|
||||||
vm.handleKeyUp = handleKeyUp;
|
vm.handleKeyUp = handleKeyUp;
|
||||||
vm.closeSearch = closeSearch;
|
vm.closeSearch = closeSearch;
|
||||||
|
vm.focusSearch = focusSearch;
|
||||||
|
|
||||||
function onInit() {
|
function onInit() {
|
||||||
vm.searchQuery = "";
|
vm.searchQuery = "";
|
||||||
vm.searchResults = [];
|
vm.searchResults = [];
|
||||||
vm.hasResults = false;
|
vm.hasResults = false;
|
||||||
vm.focusSearch = true;
|
focusSearch();
|
||||||
backdropService.open();
|
backdropService.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,12 +49,19 @@
|
|||||||
* Clears the search query
|
* Clears the search query
|
||||||
*/
|
*/
|
||||||
function clearSearch() {
|
function clearSearch() {
|
||||||
vm.focusSearch = false;
|
|
||||||
vm.searchQuery = "";
|
vm.searchQuery = "";
|
||||||
|
vm.searchResults = [];
|
||||||
|
vm.hasResults = false;
|
||||||
|
focusSearch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add focus to the search field
|
||||||
|
*/
|
||||||
|
function focusSearch() {
|
||||||
|
vm.searchHasFocus = false;
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
vm.focusSearch = true;
|
vm.searchHasFocus = true;
|
||||||
vm.searchResults = [];
|
|
||||||
vm.hasResults = false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
color: @gray-7;
|
color: @gray-7;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.umb-search-input.umb-search-input {
|
.umb-search-input.umb-search-input {
|
||||||
|
|||||||
Reference in New Issue
Block a user