mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 23:37:31 +08:00
Clear the search loading indicator after pressing Enter
This commit is contained in:
parent
309bb21ffe
commit
192b77de69
|
@ -160,7 +160,7 @@ export default class Search extends Component {
|
|||
search.loadingSources++;
|
||||
|
||||
source.search(query).then(() => {
|
||||
search.loadingSources--;
|
||||
search.loadingSources = Math.max(0, search.loadingSources - 1);
|
||||
m.redraw();
|
||||
});
|
||||
});
|
||||
|
@ -189,6 +189,9 @@ export default class Search extends Component {
|
|||
* Navigate to the currently selected search result and close the list.
|
||||
*/
|
||||
selectResult() {
|
||||
clearTimeout(this.searchTimeout);
|
||||
this.loadingSources = 0;
|
||||
|
||||
if (this.value()) {
|
||||
m.route(this.getItem(this.index).find('a').attr('href'));
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user