diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift index 21eb169f..382c418c 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift @@ -124,6 +124,8 @@ class TextViewEntryField: VDS.TextArea, VDSMoleculeViewProtocol, ObservingTextFi isReadOnly = viewModel.readOnly isRequired = viewModel.required tooltipModel = viewModel.tooltip?.toVDSTooltipModel() + width = viewModel.width + transparentBackground = viewModel.transparentBackground uiTextViewDelegate = delegateObject?.uiTextViewDelegate observingTextViewDelegate = delegateObject?.observingTextFieldDelegate diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryFieldModel.swift index fa941d10..cfcef654 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryFieldModel.swift @@ -20,7 +20,9 @@ class TextViewEntryFieldModel: TextEntryFieldModel { public var editable: Bool = true public var showsPlaceholder: Bool = false public var tooltip: TooltipModel? - + public var transparentBackground: Bool = false + public var width: CGFloat? + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- @@ -29,6 +31,8 @@ class TextViewEntryFieldModel: TextEntryFieldModel { case accessibilityText case editable case tooltip + case transparentBackground + case width } //-------------------------------------------------- @@ -39,12 +43,11 @@ class TextViewEntryFieldModel: TextEntryFieldModel { try super.init(from: decoder) let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - if let editable = try typeContainer.decodeIfPresent(Bool.self, forKey: .editable) { - self.editable = editable - } - + editable = try typeContainer.decodeIfPresent(Bool.self, forKey: .editable) ?? true accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText) tooltip = try typeContainer.decodeIfPresent(TooltipModel.self, forKey: .tooltip) + transparentBackground = try typeContainer.decodeIfPresent(Bool.self, forKey: .transparentBackground) ?? false + width = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .width) } public override func encode(to encoder: Encoder) throws { @@ -53,5 +56,7 @@ class TextViewEntryFieldModel: TextEntryFieldModel { try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText) try container.encode(editable, forKey: .editable) try container.encodeIfPresent(tooltip, forKey: .tooltip) + try container.encode(transparentBackground, forKey: .transparentBackground) + try container.encodeIfPresent(width, forKey: .width) } }