From 6360eea016f1353a124fe59b1b958048007b0dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 17 Apr 2024 23:18:44 +0200 Subject: [PATCH] DefaultValueType generic --- .../packages/core/validation/mixins/form-control.mixin.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/validation/mixins/form-control.mixin.ts b/src/Umbraco.Web.UI.Client/src/packages/core/validation/mixins/form-control.mixin.ts index da6344b316..0b543dbcf7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/validation/mixins/form-control.mixin.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/validation/mixins/form-control.mixin.ts @@ -83,7 +83,8 @@ export declare abstract class UmbFormControlMixinElement export function UmbFormControlMixin< ValueType = FormData | FormDataEntryValue, T extends HTMLElementConstructor = HTMLElementConstructor, ->(superClass: T, defaultValue: ValueType = undefined as ValueType) { + DefaultValueType extends ValueType = ValueType, +>(superClass: T, defaultValue: DefaultValueType = undefined as DefaultValueType) { abstract class UmbFormControlMixinClass extends superClass { /** * This is a static class field indicating that the element is can be used inside a native form and participate in its events. @@ -354,7 +355,7 @@ export function UmbFormControlMixin< this.value = this.getInitialValue() ?? this.getDefaultValue(); } - protected getDefaultValue(): ValueType { + protected getDefaultValue(): DefaultValueType { return defaultValue; } protected getInitialValue(): ValueType {