CommunityToolkit / CommunityToolkit/Maui

[BUG] [iOS] ScrollViews in all Popup V2 popups stop scrolling after app background/resume

Open
#3,283 1 comment 0 reactions 0 assignees View on GitHub
bug needs reproduction unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

1. A Toolkit Popup V2 containing a `ScrollView` opens normally.
2. The popup can be scrolled.
3. The popup is closed.
4. The application is sent to the background.
5. The application is restored from the iOS app switcher.
6. The popup is opened again.
7. The popup is displayed, but its `ScrollView` no longer responds to scrolling.

Once this state occurs, other scrollable Toolkit popups are affected as well.

### Expected Behavior

A `ScrollView` inside a Toolkit popup should remain scrollable after the application is suspended and resumed.

### Steps To Reproduce

1. Create a .NET MAUI Shell application targeting `net10.0-ios`.
2. Install `CommunityToolkit.Maui` 14.2.2.
3. Register the Toolkit in `MauiProgram`.
4. Add a Popup V2 view containing a vertically constrained `ScrollView` with enough content to require scrolling.
5. Show the popup using the Shell extension:
```csharp
await Shell.Current.ShowPopupAsync(new ScrollPopup());

6. Scroll the popup and close it.
7. Move the application into the background.
8. Resume it from the iOS app switcher.
9. Open the popup again.
10. Attempt to scroll.

The popup opens, but the ScrollView does not scroll.

### Minimal popup example








using CommunityToolkit.Maui.Views;

namespace PopupResumeReproduction;

public partial class ScrollPopup : Popup
{
public ScrollPopup()
{
InitializeComponent();

for (var i = 1; i <= 100; i++)
{
ItemsLayout.Add(new Label
{
Text = $"Scrollable item {i}",
FontSize = 20
});
}
}

private async void OnCloseClicked(object? sender, EventArgs e)
{
await CloseAsync();
}
}

private async void OnShowPopupClicked(object? sender, EventArgs e)
{
await Shell.Current.ShowPopupAsync(new ScrollPopup());
}

### Link to public reproduction project repository

n/a

### Environment

```markdown
- CommunityToolkit.Maui: 14.2.2
- Microsoft.Maui.Controls: 10.0.90
- Target framework: net10.0-ios
- .NET SDK: 10.0.301
- .NET runtime: 10.0.9
- MAUI workload manifest: 10.0.20
- iOS workload manifest: 26.5.10315
- macOS build host: macOS 26.5, Apple Silicon
- Xcode: 26.6 (17F113)
- Deployment: Release/TestFlight
- Device: Physical iPhone
- Application architecture: Shell
- Popup API: Shell.ShowPopupAsync(...)
```

### Anything else?

On physical iOS devices, `ScrollView` controls inside CommunityToolkit.Maui Popup V2 popups stop responding to scrolling after the application has been moved to the background
and subsequently resumed.

Scrolling works correctly before the first suspend/resume cycle.

After resuming the application, the popup itself still opens and its controls remain visible, but scrollable popup content no longer scrolls. This affects all scrollable
Toolkit popups in the application, not one particular popup or one particular `ScrollView`.

The problem is reliably reproducible in Release/TestFlight builds on a physical iPhone. It has been reproduced in four separate applications sharing the same MAUI/Toolkit
architecture.

Normal page content outside Toolkit popups does not appear to be affected.

### Scope

The issue has been reproduced in four separate applications.

It is not tied to a particular popup instance:

- Reusing a cached popup reproduces it.
- Creating a completely new popup instance on every opening also reproduces it.
- All tested scrollable Toolkit popups become affected after resume.

### Workarounds attempted

The following did not fix the issue:

1. Creating a new popup instance on every opening.
2. Removing popup caching and reuse.
3. Removing manual Parent = null handling.
4. Calling InvalidateMeasure() on the popup root, containing grids, content layout, and ScrollView after the popup loaded.
5. On iOS, calling SetNeedsLayout() and LayoutIfNeeded() on the native UIScrollView.
6. Repeating the layout invalidation on two dispatcher passes after loading.
7. Removing advertisements and advertisement-related views.

This suggests that the native ScrollView's content measurement is not the primary cause.

### Suspected area

Popup V2 wraps the popup content in an internal PopupPage. On iOS it is presented using UIModalPresentationStyle.OverFullScreen.

The Shell overload of ShowPopupAsync also uses temporary Shell route registration/navigation, while the Page/INavigation overload uses modal navigation directly.

Because all Toolkit popups are affected after application activation, this may involve one of the following:

- The internal popup page or modal presentation controller retaining stale interaction state across iOS activation.
- A transparent popup/modal page remaining in the native view-controller hierarchy and intercepting pan gestures.
- The temporary Shell popup route/navigation state not being restored correctly after resume.
- A native gesture recognizer associated with the popup presentation remaining disabled, canceled, or attached to a stale view.
- An interaction between Popup V2's OverFullScreen presentation and MAUI 10.0.90 on iOS.

### Additional information

The issue is substantially easier to reproduce in TestFlight/Release on a physical iPhone than in local debug or simulator builds.

There are no exceptions or visible errors. The popup displays correctly; only scrolling interaction is lost.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the provided Popup V2 ScrollView flow using Shell.Current.ShowPopupAsync on a physical iPhone in Release/TestFlight, then inspect Popup V2's internal PopupPage and its iOS UIModalPresentationStyle.OverFullScreen presentation across activation. Compare Shell route/navigation handling with the Page/INavigation overload and verify that scrolling works after resume without stale gesture or view-controller interception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.