Skip to content

Commit dd82536

Browse files
committed
fix: fixed #1034
1 parent 004cb69 commit dd82536

File tree

1 file changed

+22
-0
lines changed
  • src/Shared/HandyControl_Shared/Controls/Input

1 file changed

+22
-0
lines changed

src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ private void PinBox_Loaded(object sender, RoutedEventArgs e)
5858

5959
_passwordBoxsGotFocusEventHandler = PasswordBoxsGotFocus;
6060
AddHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
61+
62+
FocusPasswordBox();
63+
}
64+
65+
private void FocusPasswordBox()
66+
{
67+
if (!IsFocused)
68+
{
69+
return;
70+
}
71+
72+
if (_panel.Children.Count == 0)
73+
{
74+
return;
75+
}
76+
77+
if (_panel.Children.OfType<System.Windows.Controls.PasswordBox>().Any(box => box.IsFocused))
78+
{
79+
return;
80+
}
81+
82+
FocusManager.SetFocusedElement(this, _panel.Children[0]);
6183
}
6284

6385
private void PasswordBoxsPasswordChanged(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)