Skip to content

Expose the string prefix from Editor<T> so that other components can consume it (title updated to reflect context) #53373

@akorchev

Description

@akorchev

Background and Motivation

I am one of the developers of the Radzen.Blazor component library and would like to use HtmlFieldPrefix and ExpressionFormatter in some of the components that we maintain.

Proposed API

I propose making HtmlFieldPrefix and ExpressionFormatter public classes in order to use them in custom Blazor components that don't inherit from InputBase. The reason for not inheriting from InputBase is that it requires a ValueExpression to be set and throws exception otherwise. It would be a breaking change for our users.

Usage Examples

We would use HtmlPrefix and ExpressionFormatter similar to InputBase for custom components in the Radzen.Blazor component library. Other vendors could use the API as well.

Alternative Designs

The alternative is to copy the implementation of ExpressionFormatter to our source code. However I don't see a workaround for a cascading parameter of type HtmlFieldPrefix which would probably lead to a different behavior than InputBase.

Risks

Not sure if making those classes public would lead to any risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Dev ExperiencePriority:1Work that is critical for the release, but we could probably ship withoutapi-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onehelp candidateIndicates that the issues may be a good fit for community to help with. Requires work from eng. team

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions