dotnetprojects/WpfToolkit

AutoCompleteBox - Internal TextBox is NULL in case of getting focus (Intermittent)

karena88 opened this issue · 0 comments

Need to add defensive coding in OnGotFocus method of AutoCompleteBox.
All other usages are under safety check except this one. Time to time it is remaining null if focus is controlled externally.

AutoCompleteBox.cs >>>
protected override void OnGotFocus(RoutedEventArgs e)
{
base.OnGotFocus(e);
FocusChanged(HasFocus());
TextBox.Focus(); // Should be if (TextBox != null) TextBox.Focus()
}