dotnet / dotnet/maui

Force Light theme makes certain controls not change colour

Open
#10,490 14 comments 6 reactions 0 assignees View on GitHub
area-controls-picker blocked external has-workaround p/2 partner/winui platform/windows s/triaged s/verified t/a11y t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

Picker has a hover of white text when forcing the light theme.

I've set the background so you can see the text colour.

Loaded page up, selected "This" from the picker:
![image](https://user-images.githubusercontent.com/63308868/193866437-350e942a-2ee8-47d4-83ee-75dcc1a59dc8.png)

If you hover over the item it'll turn white:
![image](https://user-images.githubusercontent.com/63308868/193866517-24039198-0f63-4109-8c6d-41c361d0e38c.png)

Since the light theme has a white background you can't read the text.

### Steps to Reproduce

1. Create new .NET MAUI app
2. Add a Picker such as
```


This
is
a
test

```
3. Go to App.xaml.cs and set `Current.UserAppTheme = AppTheme.Light;`
4. Set the background to something easier to see the difference e.g. `BackgroundColor="Green"` on the ContentPage
5. If you go select item from the picker then go to hover over it. The text will go from black to white and it's not readable.

### Link to public reproduction project repository

https://github.com/Spinks90/MauiLightBug

### Version with bug

Unknown/Other (please specify)

### Last version that worked well

Unknown/Other

### Affected platforms

Windows

### Affected platform versions

maui-windows 6.0.536/6.0.400

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

### Depends on
- [ ] https://github.com/microsoft/microsoft-ui-xaml/issues/4474

Contributor guide

Open the contributing guide

Research direction

Start with the public MauiLightBug reproduction and App.xaml.cs, then inspect how the Windows Picker handles hover styling when UserAppTheme is set to AppTheme.Light. Reproduce the unreadable white text on a light background and trace the relevant MAUI Windows control styling. Done means the Picker item text remains readable while hovered under the forced light theme.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.