-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] SwipeView Closes when Content Changes - fix #29088
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the SwipeView unexpectedly closes when its content changes on iOS. It implements a layout adjustment to reapply the swipe state, refactors the animation logic, and adds tests to verify the behavior.
- Update MauiSwipeView to reapply swipe state during layout.
- Refactor the swipe animation by extracting the frame-setting logic.
- Add corresponding UI and automated tests for Issue29086.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Core/src/Platform/iOS/MauiSwipeView.cs | Adjusts layout and swipe animation logic to maintain the open state |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29086.cs | Introduces a test case verifying that the SwipeView remains open |
src/Controls/tests/TestCases.HostApp/Issues/Issue29086.xaml.cs | Adds UI for the test case |
Files not reviewed (1)
- src/Controls/tests/TestCases.HostApp/Issues/Issue29086.xaml: Language not supported
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29086.cs:24
- [nitpick] Consider augmenting the screenshot verification with explicit assertions on the SwipeView state to better capture the intended non-closing behavior.
VerifyScreenshot();
src/Core/src/Platform/iOS/MauiSwipeView.cs:84
- Calling Swipe(animated: false) from within LayoutSubviews could potentially trigger repeated layout passes. Please verify that this invocation does not lead to unintended recursive layout updates.
if (_isOpen)
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
App.SwipeLeftToRight("SwipeItem"); | ||
App.Click("AddButton"); | ||
App.Click("AddButton"); | ||
VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just trigger a build. Pending test snapshots in all the platforms.
what’s the status of this? will the fix be rolled out in the coming release? |
@jfversluis could you please spare sometime to review and approve this? |
/azp run MAUI-public |
Azure Pipelines successfully started running 1 pipeline(s). |
@darrabam would you be able to test the result of this build following these instructions? https://github.com/dotnet/maui/wiki/Testing-PR-Builds |
I haven’t tested it since the video above confirms the the fix, but sure I’ll give it a try following the instructions and test it on some edge cases too. Thanks for pointing out the testing instructions! |
@kubaflo Thank you very much for the fix, it resolves the issue for Left & Top items, but not for Right & Bottom. I've updated the sample for you to test with: 2025-06-23-17-53-01.mp4 |
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
* [iOS] SwipeView Closes when Content Changes - fix * Added snapshots
Issues Fixed
Fixes #29086
Screen.Recording.2025-04-19.at.21.31.37.mov
Screen.Recording.2025-04-19.at.21.30.32.mov