haxeui-core icon indicating copy to clipboard operation
haxeui-core copied to clipboard

Incorrect Assignment of `.first` and `.last` CSS Classes When Child Elements Are Explicitly Hidden in XML

Open NipponSunrise opened this issue 5 months ago • 2 comments

Сhild elements of a container are assigned the .first and .last CSS classes incorrectly if one of the children is explicitly hidden in the XML template. This causes improper styling for visible elements.

<vbox style="padding: 5px;">
    <label styleName="itemContainer" />
    <label styleName="itemContainer" hidden="true" />
    <label styleName="itemContainer" />
    <label styleName="itemContainer" />
    <label styleName="itemContainer" />
</vbox>

Expected Behavior

Item 1 should be assigned .first. Item 5 should be assigned .last.

Current Behavior

Item 1 is assigned .first. Item 3 is correctly treated as a middle element (no specific classes assigned) Item 4 is incorrectly assigned .last. Item 5 is incorrectly treated as a middle element (no specific classes assigned)

Test app / minimal test case

https://haxeui.org/builder/?38da68ef

Your Environment

  • Official playground as well as version 1.7 from haxelib

NipponSunrise avatar Sep 22 '24 05:09 NipponSunrise