Skip to content

Commit 9103f10

Browse files
committed
combo tweak to stop carat getting scaled out of existence
1 parent ce4c7a7 commit 9103f10

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

MaterialDesignThemes.Wpf/TextFieldAssist.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private static void ApplyTextBoxViewMargin(Control textBox, Thickness margin)
8484
var frameworkElement = (textBox.Template.FindName("PART_ContentHost", textBox) as ScrollViewer)?.Content as FrameworkElement;
8585
if (frameworkElement != null)
8686
{
87-
frameworkElement.Margin = margin;
87+
frameworkElement.Margin = margin;
8888
}
8989
}
9090

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@
421421
IsHitTestVisible="False"/>
422422
<TextBox x:Name="PART_EditableTextBox"
423423
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
424+
HorizontalAlignment="Left"
425+
HorizontalContentAlignment="Stretch"
424426
Style="{StaticResource MaterialDesignComboBoxEditableTextBox}"
427+
CaretBrush="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}"
425428
Visibility="Collapsed" />
426429

427430
<wpf:SmartHint x:Name="Hint"
@@ -560,7 +563,7 @@
560563
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
561564
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
562565
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
563-
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="1 0 0 0" />
566+
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="1 0 1 0" />
564567
<Setter Property="Template" Value="{StaticResource MaterialDesignFloatingHintComboBoxTemplate}" />
565568
<Style.Triggers>
566569
<Trigger Property="IsKeyboardFocused" Value="true">

0 commit comments

Comments
 (0)