You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a design bug with the new Fluent v2 styles -- primarily the dark theme. It is not a technical issue.
With the old Fluent v1 and earlier styles, the ListViewItem selection background color was not so different from non-selected item backgrounds. In practice this means the text Foreground brush doesn't need to change if an item is selected or not. However, in Fluent v2, selected backgrounds are now significantly different from non-selected which requires inverting the text Foreground color. This works up until you until you have an input/editing control. Input controls like TextBox override the inherited Foreground color.
Fluent v1: (no issue)
Fluent v2: (issue)
With Fluent v2 in dark theme, selected ListViewItems violate the accessibility contrast requirements (set by Windows). It is hard to see regardless of the requirements themselves.
Steps to reproduce the bug
Within a ListView simply place TextBoxes or DatePicker controls as content. You will notice that the default text Foreground colors do not work if the ListViewItem is selected.
In older styles the Text foreground never needs to change. With the newer styles, editing controls must manually break the foreground brush inheritance when they are selected to avoid issues. This is not always convenient or intuitive.
Bottom line I want to know the recommended solutions Microsoft has for this issue. There needs to be something simple. I'm guessing it was missed during Fluent v2 style development. That said, I've seen styles such as the below which solve this issue but don't seem to have been released or set as the default:
Screenshots
Issue:
No Issue:
NuGet package version
No response
Windows app type
UWP
Win32
Device form factor
Desktop
Windows version
May 2021 Update (19043)
Additional context
No response
The text was updated successfully, but these errors were encountered:
@chigy@StephenLPeters My recommendation is to add another Secondardy/Alternate ListViewItem style that supports the gray background and selection pill design used in the ComboBox. That would allow apps to quickly switch to a container style that doesn't have this issue.
I'm closing this as apps are moving to Fluent v2 / Windows 11 styling in listboxes for the most part. That sidesteps this issue with the older styles.
That said, the newer listbox/listboxitem styles really should have been copied over to this WinUI library repo around the Fluent v2 timeframe. Don't know why it's mismatched in this area.
Describe the bug
This is a design bug with the new Fluent v2 styles -- primarily the dark theme. It is not a technical issue.
With the old Fluent v1 and earlier styles, the ListViewItem selection background color was not so different from non-selected item backgrounds. In practice this means the text Foreground brush doesn't need to change if an item is selected or not. However, in Fluent v2, selected backgrounds are now significantly different from non-selected which requires inverting the text Foreground color. This works up until you until you have an input/editing control. Input controls like TextBox override the inherited Foreground color.
Fluent v1: (no issue)
Fluent v2: (issue)
With Fluent v2 in dark theme, selected ListViewItems violate the accessibility contrast requirements (set by Windows). It is hard to see regardless of the requirements themselves.
Steps to reproduce the bug
Within a ListView simply place TextBoxes or DatePicker controls as content. You will notice that the default text Foreground colors do not work if the ListViewItem is selected.
Repro App:
App1.zip
Expected behavior
In older styles the Text foreground never needs to change. With the newer styles, editing controls must manually break the foreground brush inheritance when they are selected to avoid issues. This is not always convenient or intuitive.
Bottom line I want to know the recommended solutions Microsoft has for this issue. There needs to be something simple. I'm guessing it was missed during Fluent v2 style development. That said, I've seen styles such as the below which solve this issue but don't seem to have been released or set as the default:
Screenshots
Issue:
No Issue:
NuGet package version
No response
Windows app type
Device form factor
Desktop
Windows version
May 2021 Update (19043)
Additional context
No response
The text was updated successfully, but these errors were encountered: