diff --git a/src/Components/Editor/PropertiesOperations.ts b/src/Components/Editor/PropertiesOperations.ts index cccc363..92e707d 100644 --- a/src/Components/Editor/PropertiesOperations.ts +++ b/src/Components/Editor/PropertiesOperations.ts @@ -97,32 +97,25 @@ export function OnPropertiesSubmit( // Assign container properties for (const property in container.properties) { - const input = (event.target as HTMLFormElement).querySelector(`#${property}`); - if (input instanceof HTMLInputElement) { - (container.properties as any)[property] = input.value; + const input: HTMLInputElement | null = (event.target as HTMLFormElement).querySelector(`#${property}`); - if (INPUT_TYPES[property] === 'number') { - (container.properties as any)[property] = Number(input.value); - continue; - } + if (input === null) { + continue; + } - (container.properties as any)[property] = input.value; + (container.properties as any)[property] = input.value; + if (INPUT_TYPES[property] === 'number') { + (container.properties as any)[property] = Number(input.value); } } // Assign cssproperties for (const styleProperty in container.properties.style) { - const input = (event.target as HTMLFormElement).querySelector(`#${styleProperty}`); - if (input instanceof HTMLInputElement) { - (container.properties.style as any)[styleProperty] = input.value; - - if (INPUT_TYPES[styleProperty] === 'number') { - (container.properties.style as any)[styleProperty] = Number(input.value); - continue; - } - - (container.properties.style as any)[styleProperty] = input.value; + const input: HTMLInputElement | null = (event.target as HTMLFormElement).querySelector(`#${styleProperty}`); + if (input === null) { + continue; } + (container.properties.style as any)[styleProperty] = input.value; } if (container.properties.isRigidBody) {