-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Pillar: Complete Blazor Webaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the futurefeature-blazor-form-validationThis issue is related to forms validation in BlazorThis issue is related to forms validation in Blazorseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
Follows on from #7614
Design ideas:
* - Add method: editContext.AddValidationTask(FieldIdentifier f, Task t)
* It adds the task to a HashSet<Task> on both the FieldState and the EditContext,
* so we can easily get all the tasks for a given field and across the whole EditContext
* Also it awaits the task completion, and then regardless of outcome (success/fail/cancel),
* it removes the task from those hashsets.
* - Add method: editContext.WhenAllValidationTasks()
* Add method: editContext.WhenAllValidationTasks(FieldIdentifier f)
* These return Task.WhenAll(hashSet.Values), or Task.Completed if there are none
* - Optionally also add editContext.HasPendingValidationTasks()
* - Add method: editContext.ValidateAsync() that awaits all the validation tasks then
* returns true if there are no validation messages, false otherwise
* - Now a validation library can register tasks whenever it starts an async validation process,
* can cancel them if it wants, and can still issue ValidationResultsChanged notifications when
* each task completes. So a UI can determine whether to show "pending" state on a per-field
* and per-form basis, and will re-render as each field's results arrive.
* - Note: it's unclear why we'd need WhenAllValidationTasks(FieldIdentifier) (i.e., per-field),
* since you wouldn't "await" this to get per-field updates (rather, you'd use ValidationResultsChanged).
* Maybe WhenAllValidationTasks can be private, and only called by ValidateAsync. We just expose
* public HasPendingValidationTasks (per-field and per-edit-context).
Will implement this shortly after getting more of the system in place, assuming it still appears to be the correct design.
Xeevis, Dreamescaper, IvanJosipovic, chrissainty, isobel-cullen and 20 more
Metadata
Metadata
Assignees
Labels
Pillar: Complete Blazor Webaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the futurefeature-blazor-form-validationThis issue is related to forms validation in BlazorThis issue is related to forms validation in Blazorseverity-minorThis label is used by an internal toolThis label is used by an internal tool