Skip to content

Commit 731e13e

Browse files
authored
Merge pull request #10 from WaveEngine/FocusFix
Do not clear focus when the control change its visibility and its not focused.
2 parents 8d3b2da + a33e4cb commit 731e13e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/NumericUpDownLib/Base/AbstractBaseUpDown.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ private void this_IsVisibleChanged(object sender, DependencyPropertyChangedEvent
531531
{
532532
Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(delegate ()
533533
{
534-
Keyboard.ClearFocus();
534+
if (this.IsKeyboardFocused)
535+
{
536+
Keyboard.ClearFocus();
537+
}
538+
535539
_objMouseIncr = null;
536540
}));
537541
}

0 commit comments

Comments
 (0)