[Blazor] Optional constraint to component nesting (UI warning/Compilation error) #31175
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
In DevExpress they have a nice touch to their components where:
This is shown as an UI warning much like when you try to nest a 'div' inside an 'ul'.
E.g.:
In the
ASPxGridView
component,Columns
is a valid nestable child component:In comparison, if we try to nest an
Items
component (nestable within other components likeASPxComboBox
, but not withinASPxGridView
) or any other component/tag, like this:The UI displays a warning:
Element 'Items' not supported
.Similarly, it's not possible to use a standalone
Columns
component outside anASPxGridView
component.It would be nice to be able to:
and/or
This allows a child component to only be used where it's strictly intended to be used, like if you have events that require a determined component tree to work and also creates a failproof use of a determined component.
For example if I have a
card-list
component and acard-list-item
component with a delete button and I want thecard-list-item
component to be strictly nestable inside acard-list
component so when I click the delete button an event is always fired in the parent component.I know it's not an ultra required feature but it would be nice to have.
The text was updated successfully, but these errors were encountered: