haxeui-core
haxeui-core copied to clipboard
Cloning hidden Component
Expected Behavior
When cloning a hidden component and showing it, it should be the same as cloning a shown component.
Current Behavior
It doesn't. For example cloning a hidden button , won't clone the button text.
Test app / minimal test case
You can test this code in the builder
<vbox style="padding:5px;border: 1px solid #a9c4e2;">
<style>
.standardButton {
width: 50px;
height: 50px;
}
</style>
<button text="cloneShown" onClick="var b = buttonS.cloneComponent(); hbox.addComponent(b)"/>
<button text="cloneHidden" onClick="var b = buttonH.cloneComponent(); hbox.addComponent(b); b.show();"/>
<hbox id="hbox">
<button id="buttonS" text="shown" styleNames="standardButton"/>
<button id="buttonH" text="hidden" hidden="true" styleNames="standardButton"/>
</hbox>
</vbox>
Nice catch, that should be fixed now - the problem was that the hidden getter also returns the hidden status of its parents - so when it was cloned (c.hidden = this.hidden) it would essentially hide all child components of a hidden parent - showing (or hiding) isnt recursive (rightly so), so this means that the hidden label was never shown again.
Anyways, should be fixed in latest haxeui-core
Can this be closed?
I think so :)