[iOS] SwipeView Closes when Content Changes - fix#29088
[iOS] SwipeView Closes when Content Changes - fix#29088PureWeen merged 2 commits intodotnet:inflight/currentfrom
Conversation
There was a problem hiding this comment.
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.
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
…30182) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change A correction to this pr #29088 that fixes this comment #29088 (comment) ### Issues Fixed Fixes #29088 (comment) Fixes #32033 |Before|After| |--|--| |<video src="https://github.com/user-attachments/assets/d28d31b7-241a-43fd-832f-d8ac8abdf202" width="300px"/>|<video src="https://github.com/user-attachments/assets/c788d2d1-5227-48b3-a2ad-ae1093823057" width="300px"/>|
Issues Fixed
Fixes #29086
Screen.Recording.2025-04-19.at.21.31.37.mov
Screen.Recording.2025-04-19.at.21.30.32.mov