Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialButton TextColor style position problem #420

Open
2 of 7 tasks
Tum4ik opened this issue Apr 4, 2021 · 1 comment
Open
2 of 7 tasks

MaterialButton TextColor style position problem #420

Tum4ik opened this issue Apr 4, 2021 · 1 comment

Comments

@Tum4ik
Copy link

Tum4ik commented Apr 4, 2021

🐛 Bug Report

I don't know about other cases, but if I set "TextColor" property before "ButtonType" property in my style declaration - the text color is not applied.

Expected behavior

The "TextColor" property has to be applied independently of the position in the style declaration.

Reproduction steps

  1. Create a simple ContentPage:
<ContentPage ...>
  <ContentPage.Resources>
    <ResourceDictionary>
      <Style TargetType="material:MaterialButton" x:Key="MaterialButtonStyle">
        <Setter Property="TextColor" Value="White" />
        <Setter Property="ButtonType" Value="Outlined" />
      </Style>
    </ResourceDictionary>
  </ContentPage.Resources>
  <StackLayout Orientation="Horizontal">
      <material:MaterialButton Style="{StaticResource MaterialButtonStyle}" Text="Apply" />
      <material:MaterialButton Style="{StaticResource MaterialButtonStyle}" Text="Ok" />
  </StackLayout>
</ContentPage>
  1. Notice the text color is not white:

image

  1. Swap "TextColor" and "ButtonType" properties and notice the color is applied now:
<Style TargetType="material:MaterialButton" x:Key="MaterialButtonStyle">
  <Setter Property="ButtonType" Value="Outlined" />
  <Setter Property="TextColor" Value="White" />
</Style>

image

Configuration

Version: 1.7.8

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
@bricefriha
Copy link
Contributor

Thanks for reporting it, I'm having the same issue too.
I'll be taking a look at it this weekend. 😉

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants