Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NipponSunrise opened this issue Sep 22, 2024 · 2 comments

Comments

@NipponSunrise
Copy link

С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
@ianharrigan
Copy link
Member

Indeed, nice catch, i dont think these position classes ever take visibility into account, here are some more issues / oddities: https://haxeui.org/builder/?b7ec311b

ianharrigan added a commit that referenced this issue Sep 23, 2024
@ianharrigan
Copy link
Member

this should be fixed now in git haxeui-core - ive also update haxeui-core / haxeui-html5 on the builder, so the test case works now: https://haxeui.org/builder/?c413e987

Cheers,
Ian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants