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 Button doesn't reset to "Normal" if scrolled quickly to the top in IOS #25084

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

Root Cause:

The issue arises because the ScrollView is actively scrolling when tap the button. As a result, the TouchDown event is triggered, and the button's visual state is applied. However, the TouchUpInside event is not triggered upon release, preventing the button's state from updating correctly.

Description of Change:

  • To resolve this issue, implemented the TouchCancel event for the button, ensuring that its visual state is properly reset when the touch is released.

Tested the behaviour in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac

Reference

N/A

Issues Fixed

Fixes #19246

Output

Before

Before.mp4

After

After.1.mp4

Copy link
Contributor

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

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

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review October 9, 2024 09:18
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner October 9, 2024 09:18
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Could we include the sample from the gif and create an ui test?. Could use the DragCoordinates method to tap down, drag outside the Button and release to verify the status. Then can use the VerifyScreenshot method to validate the Button background color.

}
void HandleButtonInteraction()
{
if (VirtualView is IButton virtualView)
Copy link
Contributor

@jsuarezruiz jsuarezruiz Oct 9, 2024

Choose a reason for hiding this comment

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

VirtualView is an IButton, can directly do:

VirtualView?.Released();
VirtualView?.Clicked();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the changes as per your suggestion. Could you please validate it once from your end?

@vishnumenon2684
Copy link
Contributor

Could we include the sample from the gif and create an ui test?. Could use the DragCoordinates method to tap down, drag outside the Button and release to verify the status. Then can use the VerifyScreenshot method to validate the Button background color.

@jsuarezruiz The reported issue itself was replicating very rarely when scrolling quickly and the button press occurring concurrently. Tried adding the test case with the suggested input but the proper image is not getting generated to replicate the exact issue scenario.
Can we proceed to move without the ui test?

void HandleButtonInteraction()
{
VirtualView?.Released();
VirtualView?.Clicked();
Copy link
Member

Choose a reason for hiding this comment

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

Do we still want to trigger clicked if this is called from TouchCancel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per the suggestion, we cross-checked and confirmed that the visual state of the button is reset without invoking the clicked event during TouchCancel. Could you please verify this?

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen enabled auto-merge (squash) October 10, 2024 15:47
@PureWeen PureWeen disabled auto-merge October 10, 2024 21:26
@PureWeen
Copy link
Member

  • failed templates aren't related

@PureWeen PureWeen merged commit fef98db into dotnet:main Oct 10, 2024
94 of 97 checks passed
@samhouts samhouts added the fixed-in-net8.0-nightly This may be available in a nightly release! label Oct 14, 2024
@NirmalKumarYuvaraj NirmalKumarYuvaraj deleted the fix-19246 branch October 18, 2024 05:58
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2024
@NirmalKumarYuvaraj NirmalKumarYuvaraj added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@samhouts samhouts added fixed-in-net8.0-nightly This may be available in a nightly release! and removed 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
area-controls-button Button, ImageButton 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 platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button doesn't reset to "Normal" if scrolled quickly to the top in IOS
5 participants