UI: Only set focus on select field search boxes if the select is open

This commit is contained in:
kkthxbye-code 2022-07-15 08:51:05 +02:00
parent 57397570c0
commit b0df24e6d1
3 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -411,7 +411,12 @@ export class APISelect {
} finally { } finally {
this.setOptionStyles(); this.setOptionStyles();
this.enable(); this.enable();
this.slim.slim.search.input.focus();
// Set the focus to the search field if the select is open
if (this.slim.slim.content.classList.contains("ss-open")) {
this.slim.slim.search.input.focus();
}
this.base.dispatchEvent(this.loadEvent); this.base.dispatchEvent(this.loadEvent);
} }
} }