mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 03:13:43 +08:00
98eb014bdb
Prior to this fix, if you were following this series of events:
- type something in a select-kit filter with async search
- query starts
- type something again
- first query finished with no results
- second query starts
- 💥 we would show a no content found for a split second
- second query finishes
- we display a list of results
56 lines
1.6 KiB
Handlebars
56 lines
1.6 KiB
Handlebars
{{#unless this.selectKit.isHidden}}
|
|
{{component
|
|
this.selectKit.options.headerComponent
|
|
tabindex=this.tabindex
|
|
value=this.value
|
|
selectedContent=this.selectedContent
|
|
selectKit=this.selectKit
|
|
id=(concat this.selectKit.uniqueID "-header")
|
|
}}
|
|
|
|
<SelectKit::SelectKitBody
|
|
@selectKit={{this.selectKit}}
|
|
@id={{concat this.selectKit.uniqueID "-body"}}
|
|
>
|
|
{{#unless this.selectKit.options.useHeaderFilter}}
|
|
{{component
|
|
this.selectKit.options.filterComponent
|
|
selectKit=this.selectKit
|
|
id=(concat this.selectKit.uniqueID "-filter")
|
|
}}
|
|
|
|
{{#if this.selectedContent.length}}
|
|
<div class="selected-content">
|
|
{{#each this.selectedContent as |item|}}
|
|
{{component
|
|
this.selectKit.options.selectedChoiceComponent
|
|
item=item
|
|
selectKit=this.selectKit
|
|
}}
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
{{/unless}}
|
|
|
|
{{#each this.collections as |collection|}}
|
|
{{component
|
|
(component-for-collection collection.identifier this.selectKit)
|
|
collection=collection
|
|
selectKit=this.selectKit
|
|
value=this.value
|
|
}}
|
|
{{/each}}
|
|
|
|
{{#if this.selectKit.filter}}
|
|
{{#if (and this.selectKit.hasNoContent (not this.selectKit.isLoading))}}
|
|
<span class="no-content" role="alert">
|
|
{{i18n "select_kit.no_content"}}
|
|
</span>
|
|
{{else}}
|
|
<span class="results-count" role="alert">
|
|
{{i18n "select_kit.results_count" count=this.mainCollection.length}}
|
|
</span>
|
|
{{/if}}
|
|
{{/if}}
|
|
</SelectKit::SelectKitBody>
|
|
{{/unless}} |