dotnet / dotnet/maui

Editor control does not show all the text after increasing its height on Windows

Open
#35,903 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-controls-editor has-workaround partner/syncfusion platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

Description

If an Editor control height is smaller than the displayed text, and then is resized, the text is still displayed only in the initial rectangle and does not fill the control.

Initial window size - all the text fits and is displayed.
Image

Resize the window to be smaller than the text.
Image

Resize it again to a bigger window. The text is still displayed and scrolled in the rectangle from the smaller window size.
Image

Steps to Reproduce
  1. Create a new .NET MAUI application.

  2. Change the MainPage.xaml to

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage">
  <Grid>
    <Editor x:Name="editor"/>
  </Grid>
</ContentPage>
  1. Populate the Editor control text:
    public MainPage()
    {
      InitializeComponent();
    
      editor.Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" + 
                    "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n" + 
                    "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" + 
                    "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" + 
                    "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
    }
  1. Compile and run the application.

  2. Resize the window so that the text does not fit and can be scrolled

  3. Resize the window back to a larger size. The text should fit and be fully displayed, but is not.

Link to public reproduction project repository

No response

Version with bug

10.0.70

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

Wrapping the Editor control in a ScrollView can resolve the issue.

Relevant log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows with the provided MainPage.xaml and Editor text, resizing the window smaller and then larger. Trace the Editor's resize behavior in the .NET MAUI repository and add or run coverage for the repro; done means the text uses the control's enlarged area and is fully displayed after resizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.