more changes to modal flow, fixes some issues I hope

This commit is contained in:
Moritz Jung 2026-05-21 20:04:33 +02:00
parent 5a032a87ae
commit 898b495f52
7 changed files with 301 additions and 42 deletions

View file

@ -38,6 +38,8 @@ export class MediaDbAdvancedSearchModal extends Modal {
keyPressCallback(event: KeyboardEvent): void {
if (event.key === 'Enter') {
event.preventDefault();
event.stopImmediatePropagation();
void this.search();
}
}
@ -57,8 +59,9 @@ export class MediaDbAdvancedSearchModal extends Modal {
if (!this.isBusy) {
this.isBusy = true;
this.searchBtn?.setDisabled(false);
this.searchBtn?.setDisabled(true);
this.searchBtn?.setButtonText('Searching...');
this.searchBtn?.buttonEl.addClass('media-db-plugin-button-loading');
this.submitCallback?.({ query: this.query, apis: apis });
}

View file

@ -38,6 +38,8 @@ export class MediaDbIdSearchModal extends Modal {
keyPressCallback(event: KeyboardEvent): void {
if (event.key === 'Enter') {
event.preventDefault();
event.stopImmediatePropagation();
void this.search();
}
}
@ -55,8 +57,9 @@ export class MediaDbIdSearchModal extends Modal {
if (!this.isBusy) {
this.isBusy = true;
this.searchBtn?.setDisabled(false);
this.searchBtn?.setDisabled(true);
this.searchBtn?.setButtonText('Searching...');
this.searchBtn?.buttonEl.addClass('media-db-plugin-button-loading');
this.submitCallback?.({ query: this.query, api: this.selectedApi });
}

View file

@ -41,6 +41,8 @@ export class MediaDbSearchModal extends Modal {
keyPressCallback(event: KeyboardEvent): void {
if (event.key === 'Enter') {
event.preventDefault();
event.stopImmediatePropagation();
void this.search();
}
}
@ -60,8 +62,9 @@ export class MediaDbSearchModal extends Modal {
if (!this.isBusy) {
this.isBusy = true;
this.searchBtn?.setDisabled(false);
this.searchBtn?.setDisabled(true);
this.searchBtn?.setButtonText('Searching...');
this.searchBtn?.buttonEl.addClass('media-db-plugin-button-loading');
this.submitCallback?.({ query: this.query, types: types });
}