Skip to content

Commit 7bdf9f9

Browse files
authored
fix(PasswordBox): Do not blur if PasswordBox not focused (microsoft#1530)
Ensure that the blur command, which works by focusing on the current window Frame, does not execute if the PasswordBox does not currently have focus.
1 parent 18a84c7 commit 7bdf9f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ReactWindows/ReactNative/Views/TextInput/ReactPasswordBoxManager.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,11 @@ public override void ReceiveCommand(PasswordBox view, int commandId, JArray args
424424
}
425425
else if (commandId == ReactTextInputManager.BlurTextInput)
426426
{
427-
var frame = Window.Current?.Content as Frame;
428-
frame?.Focus(FocusState.Programmatic);
427+
if (FocusManager.GetFocusedElement() == view)
428+
{
429+
var frame = Window.Current?.Content as Frame;
430+
frame?.Focus(FocusState.Programmatic);
431+
}
429432
}
430433
}
431434

0 commit comments

Comments
 (0)