maui icon indicating copy to clipboard operation
maui copied to clipboard

[iOS] MAUI Theme breaks when system prompt visible

Open drasticactions opened this issue 2 years ago • 0 comments

Description

I think it's related to this: https://github.com/dotnet/maui/issues/15962#issuecomment-1621304855

When you switch back and forth between apps, the trait change event is fired from iOS for Light, then Dark, themes. When you don't have a system prompt on screen, both events fire and the app theme changes. When a system prompt is on screen, however, both events still fire, but MAUI only processes the first event so it sticks to the "light" mode. This also happens in reverse if your system is in light mode; it will be stuck in dark mode.

You can fix it by switching off the prompt and renavigating back to the page, or handling themes yourself by setting UserAppTheme.

https://github.com/dotnet/maui/assets/898335/eb28f667-77e6-4343-87c1-8b36e8238dba

I'm not sure if this is a "regression" in MAUI, in that it's either a change in iOS that's causing behavior that now breaks what happens in MAUI, or it's always been happening.

Steps to Reproduce

Run the sample

Link to public reproduction project repository

https://github.com/drasticactions/MauiRepros/blob/main/MauiTheme/

Version with bug

8.0.3

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

No response

Did you find any workaround?

No response

Relevant log output

No response

drasticactions avatar Dec 29 '23 03:12 drasticactions