-
I have implemented a GLSP UIExtension showing a property panel when a node element is selected. The property panel uses JsonForms to display custom properties of a node element so that the user can change them: This is all working very well, jsonForms are a cool feature! To react on changes I have added a callBack method to the jsonForms if (element instanceof EventNode) {
const event: EventNode = element;
ReactDOM.render(
<JsonForms
data={event.propetriesData}
cells={vanillaCells}
renderers={vanillaRenderers}
onChange={({ errors, data }) => this.setState({ data })}
/>,
this.bodyDiv
); But the I would have expected that the onChange is equal to So my question is if there is a elegant way to bind my callback to the input.onchange event? Or maybe an event when the users leaves the jsonForm (something like onblur..) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is kind of a recurrent issue.
IMHO it would probably be worth to propose a new enhancement to enable both behaviors in jsonforms. We could then configure with a simple option whether onChange events are triggerred on focus loss or on each typing event. Unfortunately, such an enhancement means upgrading each renderer implementation, not only your preferred one. Edit upgrade: looking at implementations, it looks like the change is called at 'onChange' event of the input... but called nevertheless at each character change. So I'm not sure, with React and Material in the loop, wheter |
Beta Was this translation helpful? Give feedback.
This is kind of a recurrent issue.
Currently, there are two approaches to workaround it it: