Capturing onclick event on existing controls?

Hi. Thank you so much for the product and the support. I’m looking to create code that increments integer control values upon the user clicking (or touching) the control. Is there an onclick event that can be captured for all controls, or would I need to create a custom control to do that? thanks again.

[original thread by Curt Sorkin]

Hi @curt-sorkin, thanks for your interest in JSON Forms! You can listen to state changes in redux, or to data and validation changes in the standalone version. So if you render an integer control you’ll be notified when the user changes the integer, for example via clicks on the up/down-arrows of the input.

If you need more fine-grained control you’ll need to implement a custom renderer where you can do whatever you want including listening to click / touch or any other event.

I hope this was helpful to you :slight_smile: Check this tutorial to see how to implement an own integer renderer: https://jsonforms.io/docs/custom-renderers