You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I quickly click a button, sometimes the previous state is logged to the console. I can never be sure that I'm accessing actual form data (or at least I don't know how to get to them since there is no real reference to them or to the form)
constinitialData={name: 'Max Power',};constClearFormExample=()=>{const[data,setData]=useState(initialData);return(<div><JsonFormsschema={schema}uischema={uischema}data={data}renderers={materialRenderers}cells={materialCells}onChange={({ data, _errors })=>setData(data)}/><ButtononClick={()=>console.log(data)}color='primary'>
Print data
</Button></div>);};
Expected behavior
It would be nice to be able to directly access the internal state of the form by reference
Steps to reproduce the issue
Just try the modified example from the docs
Screenshots
No response
Which Version of JSON Forms are you using?
v3.1.0
Framework
React
RendererSet
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
In the React Material renderers we have two debounce mechanisms:
We debounce textual inputs like "string", "number" etc. within a 300ms time window. As these changes are debounced, they are not even part of the internal form wide data storage until they are applied
You are likely hitting the first debounce. If you type fast and then click on a button. Obviously that's not great.
There are multiple improvements which can be done:
The debounce should be canceled and immediately applied when an input loses focus as we don't expect further input
Exposing the formwide state via ref makes sense to me
JSON Forms and/or especially debouncing renderers should indicate the debouncing state to the outside world, for example also via the ref. So clients can wait until the latest update is available.
Would you be interested in contributing one or more of these improvements?
Describe the bug
When I quickly click a button, sometimes the previous state is logged to the console. I can never be sure that I'm accessing actual form data (or at least I don't know how to get to them since there is no real reference to them or to the form)
Expected behavior
It would be nice to be able to directly access the internal state of the form by reference
Steps to reproduce the issue
Screenshots
No response
Which Version of JSON Forms are you using?
v3.1.0
Framework
React
RendererSet
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: