Try waiting for updateComplete before sending focus to search input

Maybe fixes search field doesn't get focus when clicking on select
This commit is contained in:
nathan 2023-11-27 14:54:55 -07:00
parent c4d85dd319
commit 973ce140d4

View File

@ -742,9 +742,12 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
_handleAfterShow() _handleAfterShow()
{ {
if(this.searchEnabled || this.allowFreeEntries) if(this.searchEnabled || this.allowFreeEntries)
{
this.updateComplete.then(() =>
{ {
this._searchInputNode.focus(); this._searchInputNode.focus();
this._searchInputNode.select(); this._searchInputNode.select();
});
} }
return; return;
// Need to give positioner a chance to position. // Need to give positioner a chance to position.