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