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

Fixed the double tap editor freeze issue and added test cases #26203

Merged
merged 8 commits into from
Dec 6, 2024

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Nov 28, 2024

Issue Details

Double-tapping the editor causes the app to freeze or become unresponsive.

Root Cause

When you double-tap the editor and AutoSize is set to "TextChanges," the editor continuously resizes to fit the content, leading to the app freezing or hanging.

Description of Change

  • Avoided calling PlatformView.SizeToFit() directly within the GetDesiredSize() method. Instead, a more controlled approach is used to measure the size.

Issues Fixed

Fixes #25975
Fixes #25940
Fixes #25938
Fixes #17757

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before After
BeforeFix.mp4
AfterFix.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 28, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -61,16 +61,16 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra
// get an exception; it doesn't know what do to with it. So instead we'll size
// it to fit its current contents and use those values to replace infinite constraints

PlatformView.SizeToFit();
var sizeThatFits = PlatformView.SizeThatFits(new CGSize(widthConstraint, heightConstraint));
Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly the same logic is applied in the SearchBar, happens the same problem? does it require the same changes?

If need the same changes, could you add a test covering the fix in the SearchBar?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jsuarezruiz, Since the issue arises when AutoSize is set in the editor, and AutoSize is not supported in the search bar, the search bar does not exhibit the freezing behavior and functions as expected.

@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review December 3, 2024 10:35
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner December 3, 2024 10:35
@jfversluis
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

PureWeen commented Dec 4, 2024

/azp run

@PureWeen PureWeen added this to the .NET 9 SR2 milestone Dec 4, 2024
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 5, 2024
@PureWeen PureWeen merged commit e72f6ad into dotnet:main Dec 6, 2024
104 checks passed
@samhouts samhouts added fixed-in-9.0.21 fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-editor Editor community ✨ Community Contribution fixed-in-9.0.21 fixed-in-net8.0-nightly This may be available in a nightly release! partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎
Projects
Status: Done
7 participants