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

[WinUI] Editor width is not updated when setting styles for native view #25684

Open
Lakshminatarajan opened this issue Nov 5, 2024 · 1 comment
Labels
s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Lakshminatarajan
Copy link

Description

We are using editor with custom style to disable the border of the editor. This customization affects the border to be width to be filled to the available screen width. The editor layout to the placeholder's size.


  public class CustomStyleEditor : Editor

    {

#if WINDOWS
 
        private void ApplyTextBoxStyle(Microsoft.UI.Xaml.Controls.TextBox? textbox)

        {

            var textBoxStyle = new Microsoft.UI.Xaml.Style(typeof(Microsoft.UI.Xaml.Controls.TextBox));

            textBoxStyle.Setters.Add(new Microsoft.UI.Xaml.Setter() { Property = Microsoft.UI.Xaml.Controls.Control.BorderBrushProperty, Value = new Microsoft.UI.Xaml.Media.SolidColorBrush(Windows.UI.Color.FromArgb(0, 0, 0, 0)) });

            textBoxStyle.Setters.Add(new Microsoft.UI.Xaml.Setter() { Property = Microsoft.UI.Xaml.Controls.Control.BorderThicknessProperty, Value = new Thickness(0) });
 
            textbox!.Resources.Add(typeof(Microsoft.UI.Xaml.Controls.TextBox), textBoxStyle);

        }

#endif
 
    }
 

Actual output
Image

Expected output:
Image

Note: Previously the issue occurred in v8.0.90. This has been resolved in the latest release, version 8.0.92. But it again is not working in .NET 9.0.0-rc.1.24431.7 and 9.0.0-rc.2.24503.2.

Steps to Reproduce

  1. Run the attached sample.
  2. Notice editor width issue.

Link to public reproduction project repository

https://github.com/Lakshminatarajan/MAUIEditorIssue

Version with bug

9.0.0-rc.2.24503.2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.92 SR9.2

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No.

Relevant log output

No response

@Lakshminatarajan Lakshminatarajan added the t/bug Something isn't working label Nov 5, 2024
@jaosnz-rep jaosnz-rep added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Nov 5, 2024
@jaosnz-rep
Copy link

I can repro this issue at Windows platform on the latest 17.12.0 preview 5(9.0.0-rc.2.24503.2), but it used to work in 8.0.92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants