From 6fe49d234df4730bc7838f6e597312e60171b0d5 Mon Sep 17 00:00:00 2001 From: Jakob Vogelsang Date: Sun, 27 Feb 2022 13:14:44 +0100 Subject: [PATCH] fix(editors/template): create element with NS definition (#567) --- src/editors/templates/datype-wizards.ts | 3 ++- src/editors/templates/enumtype-wizard.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editors/templates/datype-wizards.ts b/src/editors/templates/datype-wizards.ts index ee76e9dc05..56297cfb92 100644 --- a/src/editors/templates/datype-wizards.ts +++ b/src/editors/templates/datype-wizards.ts @@ -13,6 +13,7 @@ import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation'; import '../../wizard-textfield.js'; import { Create, + createElement, EditorAction, getValue, identity, @@ -153,7 +154,7 @@ function addPredefinedDAType( : null; const element = values.selected ? selectedElement!.cloneNode(true) - : parent.ownerDocument.createElement('DAType'); + : createElement(parent.ownerDocument, 'DAType', {}); element.setAttribute('id', id); if (desc) element.setAttribute('desc', desc); diff --git a/src/editors/templates/enumtype-wizard.ts b/src/editors/templates/enumtype-wizard.ts index 95be8305e2..8146cce622 100644 --- a/src/editors/templates/enumtype-wizard.ts +++ b/src/editors/templates/enumtype-wizard.ts @@ -189,7 +189,7 @@ function createAction(parent: Element, templates: XMLDocument): WizardActor { .querySelector(`EnumType[id="${values.selected.value}"]`)! .cloneNode(true) ) - : parent.ownerDocument.createElement('EnumType'); + : createElement(parent.ownerDocument, 'EnumType', {}); element.setAttribute('id', id); if (desc) element.setAttribute('desc', desc);