From eb1b78663c38d5c4e9f8c074d520ba072391bc36 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 27 Sep 2022 14:53:44 -0700 Subject: [PATCH] fix: field defaults not being defined correctly (#6453) --- core/field.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/field.ts b/core/field.ts index a72d46c0115..32c43a8fed5 100644 --- a/core/field.ts +++ b/core/field.ts @@ -54,9 +54,6 @@ import * as Xml from './xml.js'; export abstract class Field implements IASTNodeLocationSvg, IASTNodeLocationWithBlock, IKeyboardAccessible, IRegistrable { - /** The default value for this field. */ - protected DEFAULT_VALUE: any = null; - /** Non-breaking space. */ static readonly NBSP = '\u00A0'; @@ -208,7 +205,9 @@ export abstract class Field implements IASTNodeLocationSvg, * A generic value possessed by the field. * Should generally be non-null, only null when the field is created. */ - this.value_ = (new.target).prototype.DEFAULT_VALUE; + this.value_ = ('DEFAULT_VALUE' in (new.target).prototype) ? + ((new.target).prototype as AnyDuringMigration).DEFAULT_VALUE : + null; /** The size of the area rendered by the field. */ this.size_ = new Size(0, 0);