-
-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
enhancementNew feature or requestNew feature or requestneeds designMore design is needed before this issue should result in a feature being implemented.More design is needed before this issue should result in a feature being implemented.
Description
Right now an IRenderedFragment/IRenderedComponent allows users to search for any child complements. However as telerik/blazor-ui#259 (comment) suggests, it can be useful to go to the root component and parent component.
Much like the DOM api, I think we can expose the following:
Children/GetChildren()
Parent?
Root
There are a few problems here though.
- Should we have these as properties of methods. While the component tree is static after each render, there is an overhead in creating RenderedFragment objects for each component in the component tree before they are needed which is the obvious approach with properties.
- We cannot meaningfully return an
IReadOnlyList<RenderedComponent<T>>
from the Children's method/property because T is not the necessary the same type. There could be a genericIReadOnlyList<RenderedComponent<T>> GetChildren<T>
that behaves likeFindComponents<T>
does (except it just searches children and not children's children), and a non-genericIReadOnlyList<RenderedFragment> Children
property that returns all children which children.
Neither of these API changes would be conflicting with the FindComponents depth first search methods, so that's a nice bonus.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds designMore design is needed before this issue should result in a feature being implemented.More design is needed before this issue should result in a feature being implemented.