Skip to content

Add extensibility point for EditContext FieldCSSClass for Blazor forms - The current options are too limited #17996

@ericgholland

Description

@ericgholland

Is your feature request related to a problem? Please describe.

The current implementation of FieldCSSClass as a baked in extension method is limited to only some combination of "modified", "valid", or "invalid". With something as important as form editing context, we need to be able to extend this with other options such as warning, busy, readonly, disabled, hidden etc... Don't limit this to a predefined set, let the developer customize as needed

Describe the solution you'd like

Simply add the ability to override the default behavior. A simple option would be to allow an action to be assigned to the editcontext. If its assigned, then allow that action to determine the cssclass for the field. A better option would be to change the current implementation into something more modular by adding adding an interface like IFieldCSSClassProvider and then allowing a custom provider to be plugged in.

Additional context

Most css frameworks already support other options - especially warning, so it would make sense to allow this extensibility point for developers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis 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 futureseverity-blockingThis label is used by an internal tool

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions