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

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

Open
Mrcubix opened this issue Oct 16, 2023 · 4 comments
Open

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

Mrcubix opened this issue Oct 16, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Mrcubix
Copy link

Mrcubix commented Oct 16, 2023

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

@Mrcubix Mrcubix changed the title [11 Nightly] :nth-last-child(1) does not seem to be working properly on ItemsRepeater [11 Nightly] :nth-last-child(1) Only evaluated once at runtime Oct 16, 2023
@timunie
Copy link

timunie commented Nov 30, 2023

@Mrcubix can you test AvaloniaUI/Avalonia#13770 ? should be in latest nightly

@Mrcubix
Copy link
Author

Mrcubix commented Dec 1, 2023

Will do tomorrow

@Mrcubix
Copy link
Author

Mrcubix commented Dec 1, 2023

Still broken in the reproducible repo, even more broken than it used to be.

All last or used to be last elements now keep their nth-last-child class even after a new one is added, and that, is for a simple case.

@timunie
Copy link

timunie commented Dec 1, 2023

That's actually good news. It means it has now a logic we can follow and we know where in code to digg. 🙂

@maxkatz6 maxkatz6 transferred this issue from AvaloniaUI/Avalonia Mar 15, 2024
@maxkatz6 maxkatz6 added the bug Something isn't working label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants