xamarin/Xamarin.Forms

[Bug][Android] An IllegalStateException is thrown when clicking Enter and a numeric Entry has focus

Offen

#7.870 geöffnet am 08.10.2019

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (1.926 Forks)batch import
a/customrenderere/3 :clock3:help wantedinactivep/Androidt/bug :bug:up-for-grabs

Repository-Metriken

Stars
 (5.644 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Description

An exception is thrown when trying to Complete (press Enter) a numeric Entry (in Android, this is an EditText with InputType NumberFlagDecimal). I am able to reproduce this in at least two scenarios, both using a custom renderer. The exception is of type IllegalStateException and the message is "focus search returned a view that wasn't able to take focus!".

Steps to Reproduce

I have attached a zip file containing two projects with a different set-up, and the issue is observed in both apps.

Test1

  1. Run the AndroidFocusIssue1 application.
  2. Select the Entry below the button. The keyboard will show.
  3. Click Enter.

Expected Behavior

The keyboard should hide.

Actual Behavior

An exception is thrown.

Test2

  1. Run the AndroidFocusIssue2 application.
  2. Select the Entry below the button. The keyboard will show.
  3. Click Enter.

Expected Behavior

The next Entry should get focused.

Actual Behavior

An exception is thrown.

Basic Information

  • Version with issue: 4.2.0.709249
  • Last known good version: 3.2.0
  • IDE: VS 2019
  • Platform Target Frameworks:
    • Android: 9.0

Screenshots

AndroidFocusIssue.zip

Contributor Guide