From b319713e0737dc506786968e25ae97d8d595a651 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 15 Dec 2022 12:02:56 +0100 Subject: [PATCH] [SM-388] Make CL boolean setters more strict (#4241) * Make CL boolean setters more restrictive * Set default value for setters --- libs/components/src/dialog/dialog/dialog.component.ts | 4 ++-- libs/components/src/form-control/form-control.component.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/components/src/dialog/dialog/dialog.component.ts b/libs/components/src/dialog/dialog/dialog.component.ts index f82be6cd6d..09e0d6a0b2 100644 --- a/libs/components/src/dialog/dialog/dialog.component.ts +++ b/libs/components/src/dialog/dialog/dialog.component.ts @@ -8,8 +8,8 @@ import { Component, Input } from "@angular/core"; export class DialogComponent { @Input() dialogSize: "small" | "default" | "large" = "default"; - private _disablePadding: boolean; - @Input() set disablePadding(value: boolean | string) { + private _disablePadding = false; + @Input() set disablePadding(value: boolean | "") { this._disablePadding = coerceBooleanProperty(value); } get disablePadding() { diff --git a/libs/components/src/form-control/form-control.component.ts b/libs/components/src/form-control/form-control.component.ts index 3dc080f71b..ac8971e61d 100644 --- a/libs/components/src/form-control/form-control.component.ts +++ b/libs/components/src/form-control/form-control.component.ts @@ -12,11 +12,11 @@ import { BitFormControlAbstraction } from "./form-control.abstraction"; export class FormControlComponent { @Input() label: string; - private _inline: boolean; + private _inline = false; @Input() get inline() { return this._inline; } - set inline(value: boolean | string | null) { + set inline(value: boolean | "") { this._inline = coerceBooleanProperty(value); }