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

Button text does not update when CharacterSpacing is applied #21488

Open
tdeborde2 opened this issue Mar 27, 2024 · 1 comment · May be fixed by #25657
Open

Button text does not update when CharacterSpacing is applied #21488

tdeborde2 opened this issue Mar 27, 2024 · 1 comment · May be fixed by #25657
Labels
area-controls-button Button, ImageButton platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@tdeborde2
Copy link

Description

Button text is not updated by either setting the Button.Text property or updating binding property when CharacterSpacing is applied.

Steps to Reproduce

  1. Create new .NET MAUI App
  2. In the template projects MainPage.xaml modify the button tag to include the CharacterSpacing attribute and set the value to greater than 0.
  3. Run the application and click the button.
  4. 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

@tdeborde2 tdeborde2 added the t/bug Something isn't working label Mar 27, 2024
@PureWeen PureWeen added platform/iOS 🍎 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-label Label, Span labels Mar 27, 2024
@PureWeen PureWeen added area-controls-button Button, ImageButton and removed area-controls-label Label, Span labels Mar 27, 2024
@PureWeen PureWeen added this to the Backlog milestone Mar 27, 2024
@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Mar 28, 2024
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 11, 2024
@XamlTest
Copy link

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

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@kubaflo kubaflo linked a pull request Nov 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-button Button, ImageButton platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending 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

Successfully merging a pull request may close this issue.

5 participants