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

Changing TextBlock VerticalAlignment using styles overrides TextBox watermark VerticalAlignment in default theme #5802

Closed
Coding-Enthusiast opened this issue Apr 20, 2021 · 0 comments · Fixed by #13295
Labels
bug help-wanted A contribution from the community would be most welcome.

Comments

@Coding-Enthusiast
Copy link

Describe the bug
Changing TextBlock VerticalAlignment using styles also changes the TextBox watermark's VerticalAlignment. This only affects the default theme not fluent theme.
I believe it's because fluent theme already overrides the alignments (both horizontal and vertical) while default theme doesn't so it inherits it from higher.

To Reproduce

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="AvaloniaWatermark.MainWindow"
        Title="AvaloniaWatermark">

  <Window.Styles>
    <Style Selector="TextBlock">
      <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>
  </Window.Styles>
  
  <TextBox Height="200" Watermark="Watermark"/>
  
</Window>

Expected behavior
The watermark should remain on top left corner regardless of what TextBlock style does.

Screenshots
watermark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A contribution from the community would be most welcome.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants