I am working on a concept which has a OTP screen. The requirement is to dismiss the keyboard automatically upon entering the last digit of the 6 digit OTP number.
Here is what I have done till now -
if (lastOTPEntry.Value != string.Empty)
{
lastOTPEntry.Unfocus();
}
Then I have an EntryRenderer
which overrides this method -
protected override void OnFocusChangeRequested(object sender, VisualElement.FocusRequestArgs e).
{
if (Control != null).
{
if (e.Focus)
{
Control.RequestFocus();
}
else
{
Control.ClearFocus();
}
}
}
Control
is a FormsEditText
But somehow the keyboard does not dismiss.
What am I doing wrong here .. ?