dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.84k stars 1.67k forks source link

Editor within Frame causes application freeze for Windows #10387

Open DelphinRP opened 1 year ago

DelphinRP commented 1 year ago

Description

Placing an Editor inside a Frame causes the application to freeze.

Note: If I put Text="Hello" instead of Text="HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello" the application does not freeze. So the freeze might depend on the amount of text set to the editor?

maui_editor_freeze

Steps to Reproduce

  1. Create a new MAUI App
  2. Open MainPage.xaml
  3. Add the following XAML before the </VerticalStackLayout>:
            <CheckBox
                x:Name="displayFrame" />
            <Frame>
                <Editor
                    IsVisible="{Binding IsChecked, Source={x:Reference displayFrame}}"
                    Text="HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello"
                    Margin="0,10,0,0"/>
            </Frame>
  4. Run the application
  5. Click the checkbox
  6. Application freezes

Link to public reproduction project repository

https://github.com/DelphinRP/maui-frame-editor-freeze

Version with bug

6.0.401

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 19044.2006

Did you find any workaround?

No

Relevant log output

No log

jsuarezruiz commented 1 year ago

Can reproduce the issue with the attached sample. However, in latest net7.0 branch cannot reproduce the freeze (an infinite layout cycle?). but there is something wrong with the Layout: issue-10387

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

dhindrik commented 1 year ago

I have a similar problem. If I have an Editor inside a StackLayout or VerticalStackLayout it freezes the app. But only when running with .NET 7. Suppose I change the project back to .NET 6 it works.

@jsuarezruiz do you think that my problem is related to this bug or should I create a new one?

I have only tested this on MacCatalyst because my current app is right now just for Mac.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 1.0. Repro on Windows 11 with below Project: 10387.zip

.NET 6: Application freeze. .NET 7: Application does not freeze, but there are some layout issues. image

last-Programmer commented 5 months ago

It is happening with ios also when we try to set the text property of the editor that is inside frame control on load. i set the text property delayed and the issue is solved