owo-lib icon indicating copy to clipboard operation
owo-lib copied to clipboard

`childById` can't access components in a collapsed `CollapsibleContainer`

Open kikugie opened this issue 6 months ago • 0 comments

CollapsibleContainer container = Containers.collapsible(Sizing.fill(), Sizing.fill(), Text.of("Example"), false);
LabelComponent label = Components.label(Text.of("A label!"));
label.id("label");

container.child(label);
container.childById(LabelComponent.class, "label"); // == null because childById doesn't look in `collapsibleChildrenView`

Even though the label is added, it can't be configured when accessed with childById. This issue is most annoying when a separate method returns a CollapsibleContainer with components that are meant to be accessed by id and configured further. For example, when container is defined in a xml file and supposed to be dynamically populated with code.

kikugie avatar Aug 22 '24 11:08 kikugie