Ghost/ghost/admin/app/components/gh-search-input.hbs
Kevin Ansfield 06aaf09336 Refactored <GhSearchInput>
no issue

- converted component to glimmer component and native class syntax
- reduced duplication by adding a description of each searchable model that is then used for data loading and searching
- removed convoluted use of computed properties as they weren't needed - the result of the search function is used by `<PowerSelect>` directly so we don't need any tracking/automated re-rendering
2022-01-11 17:35:32 +00:00

22 lines
672 B
Handlebars

<div ...attributes>
<PowerSelect
class="ember-power-select-search"
@search={{perform this.searchTask}}
@onChange={{this.openSelected}}
@onClose={{this.onClose}}
@placeholder="Search site"
@searchEnabled={{false}}
@triggerComponent="gh-input-with-select/trigger"
@renderInPlace={{true}}
@loadingMessage="Loading"
@extra={{hash
autofocus=true
inputType="search"
inputIcon="search"
inputIconClass="gh-nav-search-icon"
}}
as |name select|
>
{{highlighted-text name.title select.searchText}}
</PowerSelect>
</div>