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

WrapPanel autowrap sorting problem #16191

Open
Coloryr opened this issue Jul 2, 2024 · 6 comments
Open

WrapPanel autowrap sorting problem #16191

Coloryr opened this issue Jul 2, 2024 · 6 comments
Labels

Comments

@Coloryr
Copy link
Contributor

Coloryr commented Jul 2, 2024

Describe the bug

When the window is not that small, sorting is normal, but there is a problem with sorting when the window is smallest.
Not the smallest case:
image
The smallest case:
image

To Reproduce

Adjust window width

Expected behavior

No response

Avalonia version

11.0.11

OS

Windows

Additional context

https://github.com/Coloryr/ColorMC/blob/5f18c13347aece1accd7bdac14ed8a43d4e7634b/src/ColorMC.Gui/UI/Controls/Setting/Tab4Control.axaml#L131-L157

@Coloryr Coloryr added the bug label Jul 2, 2024
@Coloryr
Copy link
Contributor Author

Coloryr commented Jul 2, 2024

image
image

image
image

@Coloryr
Copy link
Contributor Author

Coloryr commented Jul 3, 2024

Could anybody take a look at this question?

@timunie
Copy link
Contributor

timunie commented Jul 3, 2024

If it is a question -- Don't file it as a bug!!

Otherwise, please file a very minimal sample, not your full App.

@Coloryr
Copy link
Contributor Author

Coloryr commented Jul 4, 2024

If it is a question -- Don't file it as a bug!!

Otherwise, please file a very minimal sample, not your full App.

Ok...
But I think this is a bug.
image
image
image

AvaloniaApplication1.zip

@stevemonaco
Copy link
Contributor

stevemonaco commented Jul 4, 2024

It seems like a bug to me, particularly when Margin is involved (either left or right side) and the item cannot fit on a single line. If Margin is removed, then the behavior appears correct. The next item is moved onto the same already overfilled line (when checking Bounds in DevTools). There's different behavior between Avalonia and WPF, too. Using a simplified repro in 11.1-rc2:

<WrapPanel>
  <TextBlock FontSize="24" Text="01234567890123456789" Margin="0,0,50,0" Background="Orange" />
  <TextBlock FontSize="24" Text="9876543210" />
</WrapPanel>

Avalonia behavior:
wrappanel-margin-avalonia

WPF behavior:
wrappanel-margin-wpf

@timunie
Copy link
Contributor

timunie commented Jul 4, 2024

I agree, no item should disappear. Thx for the repo

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

No branches or pull requests

3 participants