Composite overrides getChildren() to return a stream containing the encapsulated component, but it also overrides getElement() returning the Element of the encapsulated component.
This causes the wrapped component virtual children to be fetched twice: first as children of the wrapped component, then as direct children of the Composite.
Below, an example tree printed for a Composite<Dialog> component, where the HorizontalLayout subtree is visible two times.
Composite overrides
getChildren()
to return a stream containing the encapsulated component, but it also overridesgetElement()
returning theElement
of the encapsulated component. This causes the wrapped component virtual children to be fetched twice: first as children of the wrapped component, then as direct children of theComposite
.Below, an example tree printed for a
Composite<Dialog>
component, where theHorizontalLayout
subtree is visible two times.See also https://github.com/mvysny/karibu-testing/issues/162, and https://github.com/mvysny/karibu-testing/commit/a1661d3088b30a54973d51835d1191583e755a9e for the fix provided by @mvysny