- save progress;
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { Controller } from 'react-hook-form';
|
||||
import { isNil, isEmpty } from 'ramda';
|
||||
import { isNil, isEmpty, is } from 'ramda';
|
||||
|
||||
// components
|
||||
import { InputSwitch } from 'primereact/inputswitch';
|
||||
@@ -28,7 +28,7 @@ const Switch = ({
|
||||
render={({ field, fieldState }) => (
|
||||
<InputSwitch
|
||||
inputId={fieldName}
|
||||
checked={field.value}
|
||||
checked={is(String, field.value) ? 'true' === field.value : field.value}
|
||||
disabled={disabled}
|
||||
onChange={(e) => field.onChange(e.value)}
|
||||
className={classNames({ 'p-invalid': fieldState.invalid })}/>
|
||||
|
||||
Reference in New Issue
Block a user