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

Attempting to move a TextBox from one window to another throws an exception #17906

Open
ycorre opened this issue Jan 7, 2025 · 0 comments
Open
Labels

Comments

@ycorre
Copy link

ycorre commented Jan 7, 2025

Describe the bug

There is a regression introduced in Avalonia 11.2.0 that prevents moving a TextBox from one window into another window. Each attempt is met with the following exception being thrown: "System.ArgumentException: 'Attempt to call InvalidateArrange on wrong LayoutManager.'".

The bug was introduced with Avalonia version 11.2.0: I have tested with the version 11.1.5 and the bug was not present, while it is there in versions 11.2.0 through 11.2.3.

The issue might be related to #12753 as it throws a similar exception in a similar context, although it seems to have been fixed (at least partially) since I have no issue moving buttons from one window to another.

To Reproduce

  1. Create a Window with a UserControl that contains a TextBox
  2. Create another Window and move the UserControl into it
  3. An Exception is thrown

Expected behavior

Being able to move a UserControl with a TextBox between two windows.

Avalonia version

11.2.0 - 11.2.3

OS

Windows

Additional context

I have attached a sample project for Visual Studio 2022. The application shows a window with two tabs: one with a textbox, one without. When attempting to detach the tab to a floating window, the one with the textbox throws an exception, while the other one works fine.
AvaloniaSampleProject.zip

@ycorre ycorre added the bug label Jan 7, 2025
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

1 participant