From 919746ef7729316622654633cf13a4de56012768 Mon Sep 17 00:00:00 2001 From: Mijail Todorovich Date: Mon, 26 Feb 2024 16:18:55 -0300 Subject: [PATCH 1/2] Don't focus on buttons in text input controls with Tab Set `IsTabStop=False` in the `ClearButton`, `InlineIncrementButton`, `InlineDecrementButton`, and/or `RevealButton` present in `TextBox`, `AutoSuggestBox`, `NumberBox` and `PasswordBox`. --- src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml | 3 +++ src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml | 2 ++ src/Wpf.Ui/Controls/TextBox/TextBox.xaml | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml index 12dce7090..766231f7d 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml @@ -115,6 +115,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="clear" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> @@ -138,6 +139,7 @@ CommandParameter="increment" Cursor="Arrow" Foreground="{DynamicResource TextControlButtonForeground}" + IsTabStop="False" Visibility="Collapsed"> @@ -162,6 +164,7 @@ Cursor="Arrow" FontSize="{StaticResource NumberBoxButtonIconSize}" Foreground="{DynamicResource TextControlButtonForeground}" + IsTabStop="False" Visibility="Collapsed"> diff --git a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml index 862188d46..6d02f27e8 100644 --- a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml +++ b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml @@ -206,6 +206,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="clear" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> @@ -229,6 +230,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="reveal" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> diff --git a/src/Wpf.Ui/Controls/TextBox/TextBox.xaml b/src/Wpf.Ui/Controls/TextBox/TextBox.xaml index d7cfcb677..bbfc4cca1 100644 --- a/src/Wpf.Ui/Controls/TextBox/TextBox.xaml +++ b/src/Wpf.Ui/Controls/TextBox/TextBox.xaml @@ -206,6 +206,7 @@ BorderBrush="Transparent" Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> From 232be521429c4bfe93e1374bc5202c799e6bd711 Mon Sep 17 00:00:00 2001 From: Mijail Todorovich Date: Tue, 27 Feb 2024 10:21:30 -0300 Subject: [PATCH 2/2] Don't focus on ControlIcon in NumberBox --- src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml index 766231f7d..b9788ab89 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml @@ -82,6 +82,7 @@ VerticalAlignment="Top" Content="{TemplateBinding Icon}" FontSize="16" + IsTabStop="False" Foreground="{TemplateBinding Foreground}" />