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

Microsoft.Maui.Controls 8.0.90 (Latest stable) Ruins Entry Controls #24783

Closed
Dannyk90 opened this issue Sep 16, 2024 · 35 comments · Fixed by #25006
Closed

Microsoft.Maui.Controls 8.0.90 (Latest stable) Ruins Entry Controls #24783

Dannyk90 opened this issue Sep 16, 2024 · 35 comments · Fixed by #25006
Labels
area-controls-entry Entry platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@Dannyk90
Copy link

Dannyk90 commented Sep 16, 2024

Description

If you update the Maui Controls NuGet to the latest stable (currently 8.0.90), all Entry controls become very narrow and nothing will fix it apart from downgrading, I just went back to 8.0.72 and it is fine again.

This appears to only affect Windows. Not IOS or Android.

Steps to Reproduce

  1. Create a new MAUI project
  2. Add an Entry control to the home page xaml.
  3. Launch and see that it looks fine
  4. Upgrade the Maui Controls NuGet to the latest stable 8.0.90
  5. Launch project again and see that the Entry looks awful now.

Link to public reproduction project repository

No response

Version with bug

8.0.90

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.72

Affected platforms

Windows

Affected platform versions

Windows

Did you find any workaround?

Downgrading the NuGet

Relevant log output

No response

@Dannyk90 Dannyk90 added the t/bug Something isn't working label Sep 16, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@MartyIX
Copy link
Contributor

MartyIX commented Sep 16, 2024

I can see

Version with bug

9.0.0-rc.1.24453.9

That's a bit confusing.

@MartyIX
Copy link
Contributor

MartyIX commented Sep 16, 2024

Also a screenshot comparing the new and the old behavior would be very helpful here.

@Dannyk90
Copy link
Author

Dannyk90 commented Sep 16, 2024

That's a bit confusing.

Yep, unfortunately, the NuGet Project Url is just for Maui, not a specific project url for this NuGet, and that field was mandatory.

Older Version Behaviour:
image

New Version Behaviour:
image

@bronteq
Copy link

bronteq commented Sep 16, 2024

@MartyIX 8.0.90 is not yet available in the issue template

@MartyIX
Copy link
Contributor

MartyIX commented Sep 16, 2024

@MartyIX 8.0.90 is not yet available in the issue template

I see. The issue van be post-editted then.

@PureWeen PureWeen added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Sep 16, 2024
@PureWeen PureWeen added this to the .NET 8 SR9 milestone Sep 16, 2024
@baaaaif
Copy link

baaaaif commented Sep 17, 2024

Can confirm this on our App. SR9 cannot be used at the moment.
Editor does not have this bug.

image

@MartyIX
Copy link
Contributor

MartyIX commented Sep 17, 2024

Interestingly, I don't observe this behavior in my app.

@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Sep 18, 2024
@PureWeen
Copy link
Member

Interestingly, I don't observe this behavior in my app.

Yea, @Foda and I both tested this as well and couldn't reproduce

I realize the repro steps seem simple, but if you could still attach a repro just so we can validate that would be helpful.

@Dannyk90
Copy link
Author

@PureWeen , I can no longer recreate the problem. I have since updated visual studio and the .net sdk (to fix another issue).
@baaaaif maybe you can try updating those too and see if that resolves it for you too

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Sep 18, 2024
@baaaaif
Copy link

baaaaif commented Sep 18, 2024

ok, this one took me some time.
I can reproduce it with simply adding a reference to
<PackageReference Include="Telerik.UI.for.Maui" Version="7.1.0" />
without even using .UseTelerik() in MauiProgram

really strange...
may you've had this too, @Dannyk90 ?

@Dannyk90
Copy link
Author

@baaaaif , the problem does happen again if I install Telerik NuGet and put .UseTelerik() in MauiProgram.cs

@baaaaif
Copy link

baaaaif commented Sep 18, 2024

@TelerikMauiTeam sorry for pinging, but might be in your interest

@ninachen03 ninachen03 added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Sep 19, 2024
@ninachen03
Copy link

ninachen03 commented Sep 19, 2024

This issue has been verified using Visual Studio 17.12.0 Preview 2.0(8.0.90 & 8.0.80 &8.0.72). Cannot repro this issue at windows platform.
By the way,I can't use the Telerik.UI.for.Maui,Is there anything special about it?
image

@drasticactions
Copy link
Contributor

This issue has been verified using Visual Studio 17.12.0 Preview 2.0(8.0.90 & 8.0.80 &8.0.72). Cannot repro this issue at windows platform. By the way,I can't use the Telerik.UI.for.Maui,Is there anything special about it? image

Yes, they are not on Nuget, I believe you need to download them from Telerik's website

@Dannyk90
Copy link
Author

Telerik have their own NuGet source

@dotnet-policy-service dotnet-policy-service bot removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Sep 19, 2024
@cmpalmer66
Copy link

I verified that, starting from a fresh templated project and updating Maui to 8.0.90, the problem did not appear until I added a reference to Telerik's UI for .NET Maui 7.1.0.

Before:
image

After adding the Telerik Nuget package (but not adding UseTelerik() to the Builder):
image

I've attached my sample project with the Telerik reference. You can run it to verify that the problem only appears on WinUI and goes away when the Telerik reference is removed.
WinUIEntryBug.zip

@PureWeen
Copy link
Member

I'm going to close this issue for now unless I hear otherwise from Telerik

Can you create an issue using their support system and reference this issue?

@PureWeen PureWeen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
@PureWeen PureWeen removed this from the .NET 8 SR9 milestone Sep 20, 2024
@PureWeen PureWeen removed s/needs-attention Issue has more information and needs another look potential-regression This issue described a possible regression on a currently supported version., verification pending labels Sep 20, 2024
@cmpalmer66
Copy link

I did create an issue for Telerik. I am curious as to the cause, though, because the problem arose on the release of Maui 8.0.90, not on the release of the Telerik 7.1.0, which has been out and working for a while.

https://feedback.telerik.com/maui/1665106-version-7-1-0-and-maui-version-8-0-90-break-sizing-of-winui-entry-controls

@malsabi
Copy link

malsabi commented Sep 23, 2024

When I updated to MAUI 8.0.90 I had the same Issue and I was not using Telerik. Maybe this issue happens when you attempt to make the Entry borderless? cause my entry is borderless by setting BorderThickness to 0 for Windows platform. I had to downgrade back to 8.0.80

@LanceMcCarthy
Copy link

LanceMcCarthy commented Sep 23, 2024

HI Shane, it is a holiday in Sofia today, but I'll make sure the team take a look at it tomorrow morning (about 1 am Redmond time tonight) follows up in that public item once there is a determination.

@malsabi This is a very important insight that could swing the investigation in the right direction. When adding the Telerik package, you are applying some standard implicit styles, and there are 0-width BorderThickness values in the styles. Can you please share the XAML (and any associated Style) for the Entry that is affected?

[edit] Fixed misspellings

@LanceMcCarthy
Copy link

LanceMcCarthy commented Sep 23, 2024

Note

Disregard this finding for now, I'm seeing a different behavior each time I check a different style. I need to leave this up to the dev team to dig deeper and find exactly where the influences are coming from. Thanks for hanging in there while they work on it.

Hi @PureWeen, I can reproduce the issue without Telerik involvement. As @malsabi suspected, this is indeed related to when the StrokeThickness property is set to 0.

The reason it initially seemed to be related to Telerik is because we have implicit styles to standardize the styling. when you add our package, the Entry's default style has StrokeThickness set to 0 by default, while the Microsoft File > New > Maui project has this value set to 1 by default.

I am still waiting on the engineering team to verify my findings for the Telerik Feedback Portal item.

[edit] Removed code snippet that is no longer relevant, added note.

@cmpalmer66
Copy link

I may be seeing a similar (related?) issue with the widths of the CheckBox controls in WinUI. They are stuck at about a couple of cm wide (with blank space to the right of the checkbox) and setting their WidthRequest or changing their parent container doesn't seem to affect how they render. I had to put the checkbox in grid cell with a ColumnDefinition with a width of "35" to clip the extra space off the Checkbox.

Later tonight, I'm going to try to isolate this problem. It may be related to this issue, or it may be a separate issue. The reason I suspected they might be related is that the extent of the CheckBox control is about the same width that the Entry control is locked to, and, like the Entry, it doesn't respect WidthRequests etc.

@malsabi
Copy link

malsabi commented Sep 24, 2024

@PureWeen Can you please reopen this issue and fix it as soon as possible

@LanceMcCarthy
Copy link

Hi folks, after digging into the Live Visual Tree Explorer, I have some more evidence on what is responsible. Please see my 1 minute explanation with evidence at runtime https://www.screencast.com/t/v7JTtug3U

First, @cmpalmer66 the reason using HorizontalOption=Stretch has no effect is because it is already still using Strech. see my video for an explanation.

Now, what is responsible for the inner area? It depends on what part of the control we need to look at next. I highly suspect Border to be responsible, but need more time to dig into the Handler (which is of type MauiPasswordBox on Windows)

@sbloomztf
Copy link

Same issue encountered today, and yes I am using telerik controls, but this is a new bug introduced in 8.0.90. It was okay with 8.0.82.

@LanceMcCarthy
Copy link

@sbloomztf As a temporary workaround, you can use RadEntry instead of Entry, if you have to use 8.0.90. See Didi's response here https://feedback.telerik.com/maui/1665106-version-7-1-0-and-maui-version-8-0-90-break-sizing-of-winui-entry-controls

You can follow that item to see what our findings will be, too.

@malsabi
Copy link

malsabi commented Sep 25, 2024

Why is this still considered close? Should I make a new issue? I can link a new repo without Telerik showing its still bugged when using Custom Entry with Border Thickness being set to 0. Please let me know @PureWeen

@drasticactions
Copy link
Contributor

@LanceMcCarthy Could you please create an example repo of this happening with the standalone controls? I'm unsure of what exactly you're setting or wrapping the views around, but as you said you can get it to happen outside of Telerik then this should be open until shown otherwise.

@LanceMcCarthy
Copy link

@malsabi Can you please share the demo project that reproduces the issue with @drasticactions ?

I do not have something handy, and what you just described sounds like it's the underlying problem.

@malsabi
Copy link

malsabi commented Sep 25, 2024

@LanceMcCarthy Sure here is the result without using Telerik.

I have added implicit styles in the Platforms/Windows/app.xaml for the TextBox.

Repo: https://github.com/malsabi/EntryIssue

Result:
Screenshot_1

@drasticactions
Copy link
Contributor

Yeah, there's an issue here. But it's... weird. As far as I can tell, the act of setting TextBox.BorderThickness period causes the Textbox to truncate. Setting it to 0, 1, 50, doesn't matter. It will always truncate. If you remove the style, it expands within the container.

image

With the Live Visual Tree, you can inspect the inner WinUI Elements. The Textbox itself is full width, but the elements inside it are truncated. If you set a Width on the Border, it does expand to match the specific width and the other elements in it match. But only with Border. Any other element inside it won't force it to expand.

@malsabi
Copy link

malsabi commented Sep 26, 2024

@drasticactions Yes, I noticed the same thing. When setting BorderThickness to 0 in the EntryHandler.cs class, it doesn't have any effect unless a style is applied, which then causes the same issue. This behavior started with version 8.0.90.

Note: I would expect setting BorderThickness to 0 in the EntryHandler to behave the same way as setting it through a style. I'm not sure why the border thickness only changes when a style is added.

@drasticactions
Copy link
Contributor

drasticactions commented Sep 26, 2024

I think I figured it out

#24485

This PR regressed it. I think it's forcing the delete button to truncate because it's setting the width to Auto in the inner column, and the setting of the Border width happens to trigger the inner logic within the control to resize it.

If this code is reverted, all is right again and it's full width.

スクリーンショット 2024-09-26 16 58 51 スクリーンショット 2024-09-26 17 00 46

This only would be seen if you set TextBox.BorderThickness in your WinUI Themes, but I think this logic here isn't correct since it would break the basic construction of the control. IMO the safe thing to do would be to revert it to the original implementation and rethink this. @PureWeen

@PureWeen PureWeen added this to the .NET 8 SR9 milestone Sep 26, 2024
@LanceMcCarthy
Copy link

Nice find @drasticactions!

This also explains why it initially appeared to be a Telerik issue (because we do have native styles to adhere to cross platform consistency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-entry Entry platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.