Repository navigation
Closed
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonplatform/iospotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
Button text is not updated by either setting the Button.Text property or updating binding property when CharacterSpacing is applied.
Steps to Reproduce
- Create new .NET MAUI App
- In the template projects MainPage.xaml modify the button tag to include the CharacterSpacing attribute and set the value to greater than 0.
- Run the application and click the button.
- Observe the button text does not update.
Link to public reproduction project repository
https://github.com/tdeborde2/ButtonCharSpacingIssue
Version with bug
8.0.3 GA
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
Calling SetAttributedTitle method resolves the issue.
var platformButton = button.Handler?.PlatformView as UIKit.UIButton;
if (platformButton != null)
{
var titleLabel = platformButton.TitleLabel;
titleLabel.Text = button.Text;
var attributedText = titleLabel.AttributedText?.WithCharacterSpacing(button.CharacterSpacing);
platformButton.SetAttributedTitle(attributedText, UIKit.UIControlState.Normal);
}Relevant log output
No response
Reacted by Tharindu Madusanka
Metadata
Metadata
Assignees
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonplatform/iospotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Activity
XamlTest commentedon Apr 11, 2024
Verified on VS 17.10.0 Preview 2.0(8.0.20). Repro on iOS 17.2 and MacCatalyst, not repro on Windows 11, Android 14.0-API34 with below Project:
ButtonCharSpacingIssue.zip
23 remaining items
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
[iOS] Button: Fix text updates with CharacterSpacing (#36326)