dotnet / dotnet/maui

MediaPicker.CapturePhotoAsync calls OnAppearing after capturing image in iOS

Open
#33,162 2 comments 0 reactions 0 assignees View on GitHub
area-essentials-mediapicker platform/ios t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

When I capture an image in iOS and after Camera window closes then OnAppearing of the page is called.

### Steps to Reproduce

1. Create new .Net MAUI project.
2. Add a button in UI and on the click of button call below code.

```
var file = await MediaPicker.CapturePhotoAsync(new MediaPickerOptions
{
Title = "Take a photo",
});

if (file != null)
{
await DisplayAlertAsync(null, "Image Captured", "Ok");
}
```

3. OnAppearing will trigger.

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.11

### Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

### Last version that worked well

Unknown/Other

### Affected platforms

iOS

### Affected platform versions

iOS 26.1

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior in a new .NET MAUI project on iOS 26.1 using MediaPicker.CapturePhotoAsync, then trace why the page's OnAppearing runs when the camera window closes. Done means photo capture still succeeds without unexpectedly triggering OnAppearing; no source files or tests are identified in the issue, so locating the relevant implementation and regression coverage is part of the work.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.