Skip to content

Button text does not update when CharacterSpacing is applied #21488

Closed

Description

@tdeborde2

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

Activity

  1. added this to the Backlog milestone on Mar 27, 2024
  2. added
    potential-regressionThis issue described a possible regression on a currently supported version., verification pending
    on Mar 28, 2024
  3. added
    s/verifiedVerified / Reproducible Issue ready for Engineering Triage
    s/triagedIssue has been reviewed
    on Apr 11, 2024
  4. XamlTest commented on Apr 11, 2024

    @XamlTest

    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

  5. removed
    legacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
    on May 10, 2024
  6. removed
    s/verifiedVerified / Reproducible Issue ready for Engineering Triage
    s/triagedIssue has been reviewed
    on Jul 3, 2024
  7. added
    s/verifiedVerified / Reproducible Issue ready for Engineering Triage
    on Jul 10, 2024
  8. 23 remaining items

  9. added this to the .NET 10 SR11 milestone on Aug 20, 2026
  10. added 12 commits that reference this issue on Aug 27, 2026
    f647449
    d2fc126
    cf34da8
    056be2b
    20d4436
    4cbcee6
    1656261
    65e926b
    336b8d9
    9a786a0
    4bd3f52
    13822c7
  11. locked and limited conversation to collaborators on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-buttonButton, ImageButtonplatform/iospotential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions