Skip to content

Commit cd0e858

Browse files
Merge pull request #2306 from Ren-Roros-Digital/defaultValue
Fix Switch defaultValue
2 parents 8192d34 + 791e567 commit cd0e858

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/forms/RFFComponents.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,16 @@ export const RFFCFormSwitch = ({
102102
disabled = false,
103103
initialValue,
104104
onClick,
105+
defaultValue,
105106
}) => {
106107
return (
107-
<Field initialValue={initialValue} name={name} type="checkbox" validate={validate}>
108+
<Field
109+
defaultValue={defaultValue}
110+
initialValue={initialValue}
111+
name={name}
112+
type="checkbox"
113+
validate={validate}
114+
>
108115
{({ meta, input }) => (
109116
<ConditionWrapper
110117
condition={helpText}

src/views/tenant/standards/ListAppliedStandards.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ const ApplyNewStandard = () => {
498498
<RFFCFormSwitch
499499
name={component.name}
500500
label={component.label}
501-
initialValue={component.default}
501+
defaultValue={component.default}
502502
/>
503503
)}
504504
{component.type === 'AdminRolesMultiSelect' && (

0 commit comments

Comments
 (0)