StarbeamOne / home

Basic central repository for issue-tracking and documentation (wiki)
MIT License
2 stars 0 forks source link

Improve User Form States (Update on Type) #82

Closed Mike-E-angelo closed 1 year ago

Mike-E-angelo commented 1 year ago

When starting this project, I used the default behavior for the form elements. The form state does not change until you blur the input field. This is default behavior for Blazor and to be honest worked fine for me back when starting out. 3 years into it I have grown acclimated to web development and my tastes have changed.

I looked into this and spent about a day converting. There are about 70 uses of text controls in our solution currently. That is a lot to test. In the limited scenarios I did test, I spent a lot of time with state and getting the view to properly refresh.

What made me backtrack on this at the moment, however, was that there is a bad change of state currently with some of our validation controls which fire on text input blur (default behavior). We have some validation controls that fire asynchronously and take an indeterminate amount of time along with our synchronous local validation. For some reason, these no longer play well together and considering the risk I am going to revert my changes and get a few important ones from user profile (change username and add email which both work fine now with the new control).

Going forward we'll be mindful of this and make any new form controls update after input and not focus. For v2 (which will most likely be a rewrite with an entire team involved 🤞), we'll have this design decision in mind from the outset.

Mike-E-angelo commented 1 year ago

I was able to get this in and we'll slowly move controls over to this. Most important ones are using it and works well ATM.