Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/openscd/src/wizard-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import 'ace-custom-element';
import './wizard-checkbox.js';
import './wizard-textfield.js';
import './wizard-select.js';
import { WizardTextField } from './wizard-textfield.js';

import {
newActionEvent,
Expand Down Expand Up @@ -198,6 +199,12 @@ export class WizardDialog extends LitElement {
/** Commits `action` if all inputs are valid, reports validity otherwise. */
async act(action?: WizardActor, primary = true): Promise<boolean> {
if (action === undefined) return false;

for (const input of dialogInputs(this.dialog))
if(input instanceof WizardTextField) {
input.ensureValueUpdated();
}

const wizardInputs = Array.from(this.inputs);
const wizardList = <List | null>(
this.dialog?.querySelector('filtered-list,mwc-list')
Expand Down
4 changes: 4 additions & 0 deletions packages/openscd/src/wizard-textfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export class WizardTextField extends LitElement {
(this.multiplierButton as HTMLElement) ?? null;
}

ensureValueUpdated(): void {
if (this.textfield) this.value = this.textfield.value;
}

checkValidity(): boolean {
if (
this.reservedValues &&
Expand Down
Loading