Skip to content

Commit

Permalink
fix(focus): [Android] Fix NRE when calling ProcessFocusChanged() with…
Browse files Browse the repository at this point in the history
… no inner TextBoxView

This can occur when the TextBox has no or an empty template.
  • Loading branch information
davidjohnoliver committed Mar 31, 2020
1 parent c6a55b1 commit fdf44ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ protected override void OnUnloaded()
if (_textBoxView != null)
{
_textBoxView.OnFocusChangeListener = null;
}

// We always force lose the focus when unloading the control.
// This is required as the FocusChangedListener may not be called
// when the unloaded propagation is done on the .NET side (see
// FeatureConfiguration.FrameworkElement.AndroidUseManagedLoadedUnloaded for
// more details.
ProcessFocusChanged(false);
// We always force lose the focus when unloading the control.
// This is required as the FocusChangedListener may not be called
// when the unloaded propagation is done on the .NET side (see
// FeatureConfiguration.FrameworkElement.AndroidUseManagedLoadedUnloaded for
// more details.
ProcessFocusChanged(false);
}
}

protected override void OnLoaded()
Expand Down

0 comments on commit fdf44ff

Please sign in to comment.