Requesting an error state
lauraz33 opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
I am having trouble building a nice error handling UX. I am using my own "editComponent" and when the user hits the save button, I am making an api call in onSave to store the data. But if I have an api error I'm struggling finding a good way to display that.
Describe the solution you'd like
I would like if there is an error prop bool that will handle some of that logic. Also possibly the onSave func can return an error or be falsey and the input will remain in edit mode and the user will see the error (similar to how onValidate works).
Describe alternatives you've considered
I tried to call my endpoint in the onValidate func, but the validation call finishes a second or two before the api call. I've tried having editMode become true if there is an error, but then the cancel button doesn't work (which is expected). Right now I am just having error text below the component. But I think it is a little confusing to the user because it does look like your input was saved (being back in display mode). And then when the user tries again, I remove the error state in my custom input component which feels a little messy.
Additional context
It would be fantastic, if the error display could look something like this...
Please let me know if I can answer any questions. This is a fantastic and flexible library. Thanks for building!
Hi @lauraz33 can you please provide me with a codepen or an example showcasing the issue you are having?