Fix currentResult got set to invalid node if results were re-rendered

This commit is contained in:
nathan 2024-09-09 11:41:51 -06:00
parent ca20de424e
commit d26b620f8d

View File

@ -594,7 +594,11 @@ export const SearchMixin = <T extends Constructor<Et2InputWidgetInterface &
this.requestUpdate("resultsOpen", false)
}
event.stopPropagation();
this.setCurrentResult(this.currentResult ?? this._resultNodes[0]);
this.setCurrentResult(
this.currentResult && this.contains(this.currentResult) ?
this.currentResult : this._resultNodes[0]
);
return;
}