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

[iOS]Resolved Button Text Resets to Previous Value When Set to Empty String Programmatically. #25171

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

Vignesh-SF3580
Copy link
Contributor

@Vignesh-SF3580 Vignesh-SF3580 commented Oct 10, 2024

Root Cause

The issue stems from UIButton managing text through two properties: CurrentTitle and TitleLabel.Text. When the button’s text is updated or cleared (set to empty), only CurrentTitle gets refreshed, while TitleLabel.Text retains the original value. This discrepancy causes the outdated text from TitleLabel.Text to reappear during the button's re-measurement, as the native-level TitleLabel.Text remains unchanged.

Description of Change

Assigned an empty string to TitleLabel when the Button Text is empty. This ensures that the title label properly reflects the current state of the button, preventing the issue where the button text would revert to its previous value during layout updates or re-measurement.

Issues Fixed

Fixes #18235

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshots

Mac:

Before After
MAC.Before.mov
Screen.Recording.2024-10-10.at.2.27.42.PM.3.mov

iOS:

Before After
IOS.Before.mov
IOS.After.mov

Sorry, something went wrong.

…a Clicked event handler causes previously set buttons to revert to previous values
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 10, 2024
Copy link
Contributor

Hey there @Vignesh-SF3580! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review October 11, 2024 10:39
@Vignesh-SF3580 Vignesh-SF3580 requested a review from a team as a code owner October 11, 2024 10:40
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@tj-devel709 tj-devel709 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find :)

@PureWeen PureWeen merged commit 67b00cb into dotnet:main Oct 14, 2024
97 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@samhouts samhouts added fixed-in-9.0.10 fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community ✨ Community Contribution fixed-in-9.0.10 fixed-in-net8.0-nightly This may be available in a nightly release! partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
6 participants