MudFileUpload: Use ParameterState#9264
Conversation
|
@igotinfected in case you want to do some manual testing, since you have experience with this component. So far, I haven't found any problems. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #9264 +/- ##
==========================================
+ Coverage 89.82% 90.98% +1.15%
==========================================
Files 412 403 -9
Lines 11878 12561 +683
Branches 2364 2438 +74
==========================================
+ Hits 10670 11429 +759
+ Misses 681 595 -86
- Partials 527 537 +10 ☔ View full report in Codecov by Sentry. |
|
LGTM, didn't see anything out of the ordinary in the docs page. For the |
It doesn't matter. Btw, shouldn't |
|
At work we use If the user loads an edit page with data already pre-filled and they just want to remove an image from a file upload that is not I did notice that in var no_errors = _formControls.All(x => x.HasErrors == false);
var required_all_touched = _formControls.Where(x => x.Required).All(x => x.Touched);
var valid = no_errors && required_all_touched;From my POV if So to answer your question, probably depends on what the consensus is for the purpose of |
Description
The main problem is that
MudFileUploaduses theMudFormComponent, which contains this pesky_valueproperty thatMudFileUploaduses as its main value.The
ParameterStatedoesn't have any mechanism to keep multiple backing fields in sync (and I don't think it should have any). Therefore, I came up with a proxy mechanism:This uses
_valueby default. However, if you want to use any other property as the main backing field for theMudFormComponent, you can override it. This is a good solution because it's not a breaking change, and you don't have to change other components that useMudFormComponent. With this, you can slowly move away from_value, which forces you to use logic in parameters.How Has This Been Tested?
Manually and current unit tests.
Type of Changes
Checklist
dev).