diff --git a/src/editors/templates/datype-wizards.ts b/src/editors/templates/datype-wizards.ts index 966360c6b1..ee76e9dc05 100644 --- a/src/editors/templates/datype-wizards.ts +++ b/src/editors/templates/datype-wizards.ts @@ -17,6 +17,7 @@ import { getValue, identity, newActionEvent, + newSubWizardEvent, newWizardEvent, patterns, selector, @@ -95,9 +96,8 @@ export function editDaTypeWizard( @click=${(e: Event) => { if (datype) e.target!.dispatchEvent( - newWizardEvent(createBDAWizard(datype)) + newSubWizardEvent(createBDAWizard(datype)) ); - e.target!.dispatchEvent(newWizardEvent()); }} > ${Array.from(datype.querySelectorAll('BDA')).map( diff --git a/src/editors/templates/dotype-wizards.ts b/src/editors/templates/dotype-wizards.ts index 3d96e8dcaf..39a2733a4e 100644 --- a/src/editors/templates/dotype-wizards.ts +++ b/src/editors/templates/dotype-wizards.ts @@ -20,6 +20,7 @@ import { identity, isPublic, newActionEvent, + newSubWizardEvent, newWizardEvent, selector, Wizard, @@ -391,8 +392,7 @@ export function dOTypeWizard( const wizard = sDOWizard({ parent: dotype, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} > { if (dotype) - e.target!.dispatchEvent(newWizardEvent(createDaWizard(dotype))); - e.target!.dispatchEvent(newWizardEvent()); + e.target!.dispatchEvent( + newSubWizardEvent(createDaWizard(dotype)) + ); }} > `, @@ -425,8 +426,7 @@ export function dOTypeWizard( doc, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} > ${Array.from(dotype.querySelectorAll('SDO, DA')).map( diff --git a/src/editors/templates/enumtype-wizard.ts b/src/editors/templates/enumtype-wizard.ts index 17b2307346..95be8305e2 100644 --- a/src/editors/templates/enumtype-wizard.ts +++ b/src/editors/templates/enumtype-wizard.ts @@ -19,6 +19,7 @@ import { identity, isPublic, newActionEvent, + newSubWizardEvent, newWizardEvent, patterns, selector, @@ -317,8 +318,7 @@ export function eNumTypeEditWizard( const wizard = eNumValWizard({ parent: enumtype, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} > (e.target).selected).value, doc, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} >${Array.from(enumtype.querySelectorAll('EnumVal')).map( enumval => diff --git a/src/editors/templates/lnodetype-wizard.ts b/src/editors/templates/lnodetype-wizard.ts index c3a5da5515..b0d5a10b72 100644 --- a/src/editors/templates/lnodetype-wizard.ts +++ b/src/editors/templates/lnodetype-wizard.ts @@ -23,6 +23,7 @@ import { identity, isPublic, newActionEvent, + newSubWizardEvent, newWizardEvent, patterns, selector, @@ -601,8 +602,7 @@ export function lNodeTypeWizard( const wizard = dOWizard({ parent: lnodetype, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} >`, html` @@ -614,8 +614,7 @@ export function lNodeTypeWizard( doc, }); - if (wizard) e.target!.dispatchEvent(newWizardEvent(wizard)); - e.target!.dispatchEvent(newWizardEvent()); + if (wizard) e.target!.dispatchEvent(newSubWizardEvent(wizard)); }} > ${Array.from(lnodetype.querySelectorAll('DO')).map( diff --git a/src/wizards/abstractda.ts b/src/wizards/abstractda.ts index 517f37fee5..9aa637d18c 100644 --- a/src/wizards/abstractda.ts +++ b/src/wizards/abstractda.ts @@ -16,6 +16,8 @@ import { maxLength, patterns } from './foundation/limits.js'; import { predefinedBasicTypeEnum, valKindEnum } from './foundation/enums.js'; function selectType(e: SelectedEvent, data: Element, Val: string | null): void { + if (!e.target || !(e.target as Select).parentElement) return; + const typeSelected = (e.target).parentElement!.querySelector(