-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
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
Disable vanilla array buttons when readonly #2303
Disable vanilla array buttons when readonly #2303
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution ❤️! Works for me!
Adapting the examples is great and allows to easily test the new functionality manually, thanks 👍!
Please also add a unit test so that the new behavior is safe from regressions.
6f4e0e4
to
ae31bad
Compare
@sdirix @joefreeman I added tests that check that buttons are rendered with expected enabled and disabled state for enabled/disabled controls. |
This updates the vanilla array controls (
TableArrayControl
andArrayControlRenderer
) to disable the buttons (for adding/removing/moving items) when the control is set to readonly (otherwise the data can be updated while readonly).To (manually) test this, I've updated the examples to support setting the
readonly
property of the<JsonForms>
, and added toggle actions to a couple of the array examples. (Not sure if there's a better way to do this?)