Skip to content

[11 Nightly] :nth-last-child(1) Only evaluated once at runtime #22

@Mrcubix

Description

@Mrcubix

Discussed in AvaloniaUI/Avalonia#12147

Originally posted by Mrcubix July 11, 2023
For some reasons, the selector :nth-last-child(1) seems to only be evaluated properly at first, any additions done after the Window is shown will result in an incorrect behavior.

in this exemple, the last element is supposed to have a margin of 0, so that the scrollbar doesn't show up until another element is added.

the same behavior can be obtained using this repo: https://github.com/Mrcubix/Avalonia-Last-Nth-Child-Selector-Issue

Note that the orginal discussion was written in an earlier version, but the issue is still valid to this day

Avalonia bug where the ItemsRepeater control only evaluates the nth-last-child(1) selector at initial render

about the same styling works for ItemsControl, however, ItemsControl suffer from a worse issue explained here #12137

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions