From c05ba4e2c81f61bddd8f43b732448fdada53dc3a Mon Sep 17 00:00:00 2001 From: Zach Teutsch <88554871+zateutsch@users.noreply.github.com> Date: Thu, 26 Mar 2026 13:14:13 -0400 Subject: [PATCH] [Keyboard Manager] Allow whitespace-only TextRemappings (#46510) Title. Closes #46453 --- .../Controls/UnifiedMappingControl.xaml.cs | 2 +- .../KeyboardManagerEditorUI/Helpers/ValidationHelper.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorUI/Controls/UnifiedMappingControl.xaml.cs b/src/modules/keyboardmanager/KeyboardManagerEditorUI/Controls/UnifiedMappingControl.xaml.cs index 022d27de8d..491986fadc 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorUI/Controls/UnifiedMappingControl.xaml.cs +++ b/src/modules/keyboardmanager/KeyboardManagerEditorUI/Controls/UnifiedMappingControl.xaml.cs @@ -564,7 +564,7 @@ namespace KeyboardManagerEditorUI.Controls return CurrentActionType switch { ActionType.KeyOrShortcut => _actionKeys.Count > 0, - ActionType.Text => !string.IsNullOrWhiteSpace(TextContentBox?.Text), + ActionType.Text => !string.IsNullOrEmpty(TextContentBox?.Text), ActionType.OpenUrl => !string.IsNullOrWhiteSpace(UrlPathInput?.Text), ActionType.OpenApp => !string.IsNullOrWhiteSpace(ProgramPathInput?.Text), _ => false, diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorUI/Helpers/ValidationHelper.cs b/src/modules/keyboardmanager/KeyboardManagerEditorUI/Helpers/ValidationHelper.cs index 526d6e01d2..9e0cde1aac 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorUI/Helpers/ValidationHelper.cs +++ b/src/modules/keyboardmanager/KeyboardManagerEditorUI/Helpers/ValidationHelper.cs @@ -90,7 +90,7 @@ namespace KeyboardManagerEditorUI.Helpers return ValidationErrorType.EmptyOriginalKeys; } - if (string.IsNullOrWhiteSpace(textContent)) + if (string.IsNullOrEmpty(textContent)) { return ValidationErrorType.EmptyTargetText; }