Skip to content

Commit 8fb125c

Browse files
fix(wizard-dialog): make sure to close on non empty editor action
1 parent 2ccb7b0 commit 8fb125c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export function getMultiplier(input: WizardInput): string | null {
229229
export type WizardMenuActor = () => WizardAction[];
230230

231231
/** User interactions rendered in the wizard-dialog menu */
232-
interface MenuAction {
232+
export interface MenuAction {
233233
label: string;
234234
icon?: string;
235235
action: WizardMenuActor;

src/wizard-dialog.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ export class WizardDialog extends LitElement {
163163

164164
const wizardActions = action();
165165

166-
wizardActions.forEach(wa =>
167-
isWizardFactory(wa)
168-
? this.dispatchEvent(newSubWizardEvent(wa))
169-
: this.dispatchEvent(newActionEvent(wa))
170-
);
166+
wizardActions.forEach(wa => {
167+
if (isWizardFactory(wa)) this.dispatchEvent(newSubWizardEvent(wa));
168+
else {
169+
this.dispatchEvent(newWizardEvent());
170+
this.dispatchEvent(newActionEvent(wa));
171+
}
172+
});
171173
return true;
172174
}
173175

0 commit comments

Comments
 (0)