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] Fix ScrollTo method issues #15984

Merged
merged 24 commits into from
Aug 21, 2023
Merged

[iOS] Fix ScrollTo method issues #15984

merged 24 commits into from
Aug 21, 2023

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Fix iOS ScrollTo method issues.

fix-7295

To validate the changes can use the added sample in the .NET MAUI Gallery in Control > ScrollView.

Issues Fixed

Fixes #7295

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/iOS 🍎 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-scrollview ScrollView labels Jul 4, 2023
{
// If the ContentSize of the UIScrollView has not yet been defined,
// we create a pending scroll request that we will launch after performing the Layout and sizing process.
scrollViewHandler.PendingScrollToRequest = request;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change. Do the scroll to request once we have values in the UIScrollView ContentSize.

@jsuarezruiz jsuarezruiz marked this pull request as ready for review July 17, 2023 14:44
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Instead of exposing the event can we try the proxy approach also so we don't have new api added?

Also is it possible to add a UITest ?

@jsuarezruiz
Copy link
Contributor Author

Added UI Tests.

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Everything seems good to merge. Doesn't leak. We just need to fix the UITests seems to be failing on Windows and Android.

@samhouts samhouts added this to the .NET 8 GA milestone Jul 31, 2023
@samhouts samhouts added the backport/suggested The PR author or issue review has suggested that the change should be backported. label Aug 4, 2023
@hartez hartez self-assigned this Aug 16, 2023
hartez
hartez previously requested changes Aug 17, 2023
Copy link
Contributor

@hartez hartez left a comment

Choose a reason for hiding this comment

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

Looks good, just needs some cleanup.

src/Core/src/Platform/iOS/MauiScrollView.cs Outdated Show resolved Hide resolved
@rmarinho rmarinho enabled auto-merge (squash) August 21, 2023 10:56
@rmarinho rmarinho dismissed hartez’s stale review August 21, 2023 10:57

Feedback was address

@rmarinho rmarinho merged commit 5af60d3 into main Aug 21, 2023
34 of 39 checks passed
@rmarinho rmarinho deleted the fix-7295 branch August 21, 2023 10:57
@samhouts samhouts added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Aug 21, 2023
@hartez hartez added the backport/approved After some discussion or review, this PR or change was approved to be backported. label Aug 23, 2023
@hartez
Copy link
Contributor

hartez commented Aug 29, 2023

/backport to net7.0

@github-actions
Copy link
Contributor

Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/6017947256

@github-actions
Copy link
Contributor

@hartez backporting to net7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix iOS ScrollTo issues
Using index info to reconstruct a base tree...
A	src/Controls/src/Core/ScrollView/ScrollView.cs
M	src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
A	src/Core/src/Platform/iOS/MauiScrollView.cs
M	src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
M	src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Falling back to patching base and 3-way merge...
Auto-merging src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Auto-merging src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
CONFLICT (modify/delete): src/Core/src/Platform/iOS/MauiScrollView.cs deleted in HEAD and modified in Fix iOS ScrollTo issues. Version Fix iOS ScrollTo issues of src/Core/src/Platform/iOS/MauiScrollView.cs left in tree.
Auto-merging src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
CONFLICT (content): Merge conflict in src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
Auto-merging src/Controls/src/Core/ScrollView.cs
CONFLICT (content): Merge conflict in src/Controls/src/Core/ScrollView.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix iOS ScrollTo issues
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

@hartez an error occurred while backporting to net7.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

hartez added a commit that referenced this pull request Aug 30, 2023
* Fix iOS ScrollTo issues

---------

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
PureWeen pushed a commit that referenced this pull request Sep 18, 2023
* Fix iOS ScrollTo issues

---------

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
rmarinho pushed a commit that referenced this pull request Sep 20, 2023
* [iOS] Fix ScrollTo method issues (#15984)

* Fix iOS ScrollTo issues

---------

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>

* Fix build errors

* More changes

* - fix compile errors

---------

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
@Eilon Eilon added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter and removed area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels May 13, 2024
@samhouts samhouts added the fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-scrollview ScrollView backport/approved After some discussion or review, this PR or change was approved to be backported. backport/suggested The PR author or issue review has suggested that the change should be backported. fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollView.ScrollToAsync(x, y false) returns before scroll is completed (when
6 participants