From d8f6ffbd8715fe3f518bf9df3dfd7aa0f2c94140 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 31 Jul 2024 17:13:38 +0800
Subject: [PATCH] fix: fix input issue taping Tab Key and remove FocusAdorner.
---
src/Ursa.Themes.Semi/Controls/PinCode.axaml | 5 ++---
src/Ursa/Controls/PinCode/PinCode.cs | 9 +++++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/Ursa.Themes.Semi/Controls/PinCode.axaml b/src/Ursa.Themes.Semi/Controls/PinCode.axaml
index b8d87e4..7eb1aef 100644
--- a/src/Ursa.Themes.Semi/Controls/PinCode.axaml
+++ b/src/Ursa.Themes.Semi/Controls/PinCode.axaml
@@ -5,14 +5,14 @@
-
-
+
+
-
diff --git a/src/Ursa/Controls/PinCode/PinCode.cs b/src/Ursa/Controls/PinCode/PinCode.cs
index cb4e7cc..5091044 100644
--- a/src/Ursa/Controls/PinCode/PinCode.cs
+++ b/src/Ursa/Controls/PinCode/PinCode.cs
@@ -159,6 +159,15 @@ public class PinCode: TemplatedControl
protected override void OnKeyDown(KeyEventArgs e)
{
+ if (e.Key == Key.Tab && e.Source is PinCodeItem)
+ {
+ _currentIndex = MathHelpers.SafeClamp(_currentIndex, 0, Count - 1);
+ if (e.KeyModifiers == KeyModifiers.Shift)
+ _currentIndex--;
+ else
+ _currentIndex++;
+ _currentIndex = MathHelpers.SafeClamp(_currentIndex, 0, Count - 1);
+ }
base.OnKeyDown(e);
if (e.Key == Key.Back && _currentIndex >= 0)
{