mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 11:24:09 +08:00
Fix active search jumping to last item during loading
This commit is contained in:
parent
dfab94ae8a
commit
ef6040a0a8
@ -325,9 +325,10 @@ export default class Search<T extends SearchAttrs = SearchAttrs> extends Compone
|
||||
|
||||
/**
|
||||
* Get the position of the currently selected search result item.
|
||||
* Returns zero if not found.
|
||||
*/
|
||||
getCurrentNumericIndex(): number {
|
||||
return this.selectableItems().index(this.getItem(this.index));
|
||||
return Math.max(0, this.selectableItems().index(this.getItem(this.index)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user