Open namti opened 1 year ago
For the temporary solution, I use a random key
change to re-render the component manually.
import randomid from 'randomid';
...
const [ editable, setEditable ] = useState(true);
const [ randomKey, setRandomKey ] = useState(randomid(2));
const toggleReadOnly = () => {
setEditable(!editable);
setRandomKey(randomid(2));
}
return (
<Form { ...restProps } key={ randomKey } options={ { readOnly: editable } } />
)
...
Thank you for reporting it. We see the issue. If you know how to fix it in our @formio/react library, your PR will be highly appreciated.
Formio version
@formio/react@5.3.0-rc.2
React version:18.2.0
Value change of the
readOnly
option is not taking effect.Is there a way to let the
<Form />
component trigger the option change?