-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Button sizing broken by .NET9 when using the Mac UI Idiom #26154
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
@piersdeseilligny Thanks for the issue, could you share how you are using the Mac Idiom with a reproduction? I am not seeing this behavior on my end. I do believe there are some known weird behavior with the mac idioms though. |
I was able to make a reproduction project here, https://github.com/beeradmoore/maui-issue-MacCatalystButtonText Steps to reproduce:
Now run the project and the "Click me" will be truncated. Through trial and error it looks like the part of the style that is required to make it work is the implicit style for <Setter Property="FontSize" Value="14"/> This means you can also fix it by adding <Button
x:Name="CounterBtn"
Text="Click me"
FontSize="14"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center" /> However this exposes another problem. Here is the same button with no implicit style, and the explicit font size of 24. There is new horizontal padding as though the button has larger text on it, but neither the button text or its height changes. Styles out of the box work because while the font size 14 doesn't appear to change the font size, it does make the button a tad larger. Oddities like this is why my MAUI Desktop apps have styles disabled from the get go. Keeps the native styles and prevents, too much odd things happening. But ironically keeping the style would have displayed the button incorrectly as to what is expected, but correctly to at least not truncate it. |
Thanks for figuring that one out! Is it possible to reopen this issue @tj-devel709 ? |
This issue has been verified using Visual Studio code 1.96.2 (9.0.21 & 9.0.0-preview1.9973). Can repro on maccatalyst platform. but not repro in Visual Studio code 1.96.2 (8.0.100). |
Description
It seems like the sizing/layout of buttons has been broken by .NET 9 in Mac Catalyst, when using the Mac UI Idiom.
.NET 8 (correct):

.NET 9 (incorrect):

Adding padding does not fix the issue, as it ends up being inconsistent depending on the length of the text. For example, both of these buttons have
Padding="0,25"
, but now have inconsistent padding.Steps to Reproduce
Any buttons without an explicitly set size seem to have this issue:
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
MacOS 15.1.1 (at least)
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: