diff --git a/src/panel/category_panel.js b/src/panel/category_panel.js index 77b78b08e..15f573270 100644 --- a/src/panel/category_panel.js +++ b/src/panel/category_panel.js @@ -70,10 +70,10 @@ export default class CategoryPanel { } async open (options = {}) { - SearchInput.minify() - document.querySelector('.top_bar').classList.add('top_bar--category-open') if(options.category) { - this.categoryName = options.category.name + const { name, label } = options.category + this.categoryName = name + SearchInput.setInputValue(label.charAt(0).toUpperCase() + label.slice(1)) } this.active = true this.search() @@ -101,6 +101,7 @@ export default class CategoryPanel { } closeAction() { + SearchInput.setInputValue('') PanelManager.resetLayout() } diff --git a/src/ui_components/search_input.js b/src/ui_components/search_input.js index 08387ac66..f551d4aca 100644 --- a/src/ui_components/search_input.js +++ b/src/ui_components/search_input.js @@ -35,6 +35,10 @@ export default class SearchInput { window.__searchInput.searchInputHandle.blur() } + static setInputValue(value) { + window.__searchInput.suggest.setValue(value) + } + static unMinify() { document.querySelector('.top_bar').classList.remove('top_bar--small') window.__searchInput.isEnabled = true