Fix chrome deadlock when opening some select fields

This commit is contained in:
kkthxbye-code 2022-07-17 17:19:56 +02:00
parent 250265c3d9
commit 664962dc4d
3 changed files with 3 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -411,13 +411,12 @@ export class APISelect {
} finally {
this.setOptionStyles();
this.enable();
this.base.dispatchEvent(this.loadEvent);
// Set the focus to the search field if the select is open
if (this.slim.slim.content.classList.contains("ss-open")) {
// Set the focus to the search field if the select is open and no already in focus
if (this.slim.data.contentOpen && document.activeElement !== this.slim.slim.search.input) {
this.slim.slim.search.input.focus();
}
this.base.dispatchEvent(this.loadEvent);
}
}