I have a use case where our users can choose whether or not to validate their data on paste or not. I’m using the react version and I can’t seem to find a way to identify, during the beforeValidation hook, where I can determine if the validation was caused just after a paste or not.
I want to, if possible, avoid resorting to keeping some external state outside of the component (using useState and render cycle would not happen in time to catch in the beforeValidate hook) and see if there are some internals in hot that could give me access to this information.
If you need to check if pasting action has happened it can be done in the afterPaste hook, and if you need to disable validation you can do this with beforeValidate hook. Here’s an example:
However, I think you misunderstand what I mean. I know you can do that with both of those hooks, what I want to try and do is to prevent validation BUT ONLY after a paste has occurred. So with normal editing, validation is allowed, but after a paste has happened I want to prevent it from happening.
I’ve been working on it and I think I can get this to work by added a property to the React hotInstance via the table Ref, but I am wondering if hot itself has an internal property that I could use as it would be more reliable I think.