enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.12k stars 131 forks source link

Icons of multiple picker fields get the same accent color when selected #733

Open fryndorfer opened 1 month ago

fryndorfer commented 1 month ago

If you add multiple picker fields with icons to your page and then select one of them, every icon from every picker field is colored and not just the one you selected.

image

The yellow color is set in my styles.xaml as the accent color. Notice how both icons are colored yellow, while the border color changes of only the selected picker. In this screenshot, I selected the "Type" picker as indicated by the yellow border color.

Styles.xaml: image

enisn commented 1 month ago

Can you try using CanCascade="True" and BasedOn="{StaticResource InputFieldBaseStyle}" for your style?

<Style TargetType="material:PickerField" CanCascade="True" BasedOn="{StaticResource InputFieldBaseStyle}">
    <!-- ... -->
</Style>

Visual States are defined in InputField style and they're commonly used across all the InpuFields including PickerField. When you inherit your new style from InputFieldBaseStyle, the problem probably will be solved.

enisn commented 1 month ago

for more information:

Addressed in #630 and completed in #634

fryndorfer commented 1 month ago

Can you try using CanCascade="True" and BasedOn="{StaticResource InputFieldBaseStyle}" for your style?

That leads to a crash. I also tried using BaseResourceKey="InputFieldBaseStyle", then the app was able to run, but the problem with the colored icons did not go away.

image