fix: fix input issue taping Tab Key and remove FocusAdorner.

This commit is contained in:
Zhang Dian
2024-07-31 17:13:38 +08:00
parent ff666cafdc
commit d8f6ffbd87
2 changed files with 11 additions and 3 deletions

View File

@@ -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)
{