Skip to content

Commit 197af12

Browse files
Possible fix for the "missing caret" issue (#2958)
* Apply margin change to Hint Fixes the caret issue where the caret would "disappear" in RTL mode * Fix PasswordBox * Fix ComboBox Slightly different change here; triggers don't override the default, so here we just set a "working" default.
1 parent 256b939 commit 197af12

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@
852852
<Setter Property="wpf:ColorZoneAssist.Mode" Value="Standard" />
853853
<Setter Property="wpf:ComboBoxAssist.ShowSelectedItem" Value="True" />
854854
<Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
855-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
855+
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
856856
<Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
857857
<Style.Triggers>
858858
<Trigger Property="IsEditable" Value="True">

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.PasswordBox.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,15 @@
266266
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
267267
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
268268
<Setter Property="Padding" Value="16,8,12,8" />
269-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
269+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
270270
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
271271
</Trigger>
272272
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
273273
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
274274
<Setter Property="BorderThickness" Value="1" />
275275
<Setter Property="Padding" Value="16,16,12,16" />
276276
<Setter Property="VerticalContentAlignment" Value="Top" />
277-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
277+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
278278
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
279279
<Setter TargetName="Hint" Property="FloatingOffset">
280280
<Setter.Value>
@@ -764,15 +764,15 @@
764764
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
765765
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
766766
<Setter Property="Padding" Value="16,8,12,8" />
767-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
767+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
768768
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
769769
</Trigger>
770770
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
771771
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
772772
<Setter Property="BorderThickness" Value="1" />
773773
<Setter Property="Padding" Value="16,16,12,16" />
774774
<Setter Property="VerticalContentAlignment" Value="Top" />
775-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
775+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
776776
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
777777
<Setter TargetName="Hint" Property="FloatingOffset">
778778
<Setter.Value>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TextBox.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"
44
xmlns:internal="clr-namespace:MaterialDesignThemes.Wpf.Internal"
@@ -300,14 +300,14 @@
300300
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
301301
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
302302
<Setter Property="Padding" Value="16,8,12,8" />
303-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
303+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
304304
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
305305
</Trigger>
306306
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
307307
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
308308
<Setter Property="BorderThickness" Value="1" />
309309
<Setter Property="Padding" Value="16,16,12,16" />
310-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
310+
<Setter TargetName="Hint" Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
311311
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" />
312312
<Setter TargetName="Hint" Property="FloatingOffset">
313313
<Setter.Value>

0 commit comments

Comments
 (0)