We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readOnly
Formio version @formio/react@5.3.0-rc.2 React version: 18.2.0
@formio/react@5.3.0-rc.2
18.2.0
Value change of the readOnly option is not taking effect.
... const [ editable, setEditable ] = useState(true); return ( <Form { ...restProps } options={ { readOnly: editable } } /> ) ...
Is there a way to let the <Form /> component trigger the option change?
<Form />
The text was updated successfully, but these errors were encountered:
For the temporary solution, I use a random key change to re-render the component manually.
key
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 } } /> ) ...
Sorry, something went wrong.
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.
No branches or pull requests
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?The text was updated successfully, but these errors were encountered: