Using Handson Table with react wrapper, on state change of the parent component, validation is reset. So if I enter E
into a number field and then add a row the highlighting vanishes.
Currently attempting to fix this issue and in the the process make it possible to track the spreadsheets overall validation status without loosing the baked in validation in the process. So that I can add a row and maintain the validation but also have a button in the parent component (which hasn’t got access to the hot instance) disabled if there are any invalid cells.
Have seen this mentioned before in the below posts:
React Setstate Issue With Validation
React Setstate Issue With Aftervalidate
Though I took out the afterChange on these examples and the table doesn’t seem to behave any differently, I did notice the console log in the onAfterValidate doesn’t actually run and struggled to find that method in the docs. In my examples I ended up using afterValidate.
Currently working on implementing the suggestion as it seems to be the same in each. My issue is handling the validation manually could cause issue down the line if handson tables core code is changed and require a rewrite from us, also that even with the code provided I am still seeing issues.
Here is a codepen example of how my use case is set up.
Handson Table Validation Example
Farrah