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
22.26k stars 1.76k forks source link

Editor vertical text alignment not working after toggling IsVisible #25973

Open King-Taz opened 1 day ago

King-Taz commented 1 day ago

Description

After toggling IsVisible property of Editor control, the control's vertical text alignment is destroyed (goes to default setting Start). More importantly, I cannot set vertical text alignment in code behind. This appears to be a bug since horizontal text alignment is preserved as is the ability to programmatically change it.

Steps to Reproduce

Create a group of Editor controls in XAML and trigger the code behind to hide/show the control and set alignment is below. I expected the vertical alignment to be unaffected by visibility, like the horizontal alignment.

        // Show/Hide column matrix B entries
        for (int i = 1; i <= 6; i++)
        {
            string controlName = $"M1_B_{i}1";
            if (FindByName(controlName) is View control) // Assuming the control is of type View or a derived type
            {
                control.IsVisible = (i <= order);
                //M1_B_51.HorizontalTextAlignment = TextAlignment.Start;
                //M1_B_51.VerticalTextAlignment = TextAlignment.End;
            }
        }

Link to public reproduction project repository

No response

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Windows

Affected platform versions

All

Did you find any workaround?

It's not a work around, but one can just accept the default "Start" vertical alignment, which destroys the aesthetics of my app.

Relevant log output

Ying-6 commented 1 day ago

Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

King-Taz commented 1 day ago

I uploaded this and sent you an invite, let me know if you have questions

Ying-6 commented 11 hours ago

This issue has been verified using Visual Studio 17.13 Preview 1(9.0.10 & 9.0.0 & 8.0.100). Can repro this issue on Windows platform. Image