Skip to content

Commit

Permalink
reset page selector on dialog reset
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Feb 10, 2025
1 parent 4c2a16c commit 86784da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export class CollectionEdit extends BtrixElement {

private onReset() {
void this.hideDialog();
void this.thumbnailSelector?.resetFormState();
this.dirty = false;
this.errorTab = null;
this.blobIsLoaded = false;
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/features/collections/select-collection-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export class SelectCollectionPage extends BtrixElement {
}
}

public async resetFormState() {
if (!this.collection) return;
await this.initSelection(this.collection);
}

updated(changedProperties: PropertyValues<this>) {
if (changedProperties.has("selectedSnapshot")) {
this.dispatchEvent(
Expand Down

0 comments on commit 86784da

Please sign in to comment.