Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] Entry looses focus #15870

Open
Open
@MichaelRumpler

Description

@MichaelRumpler

Description

I have the same problem as @APopatanasov in dotnet/maui#5916. I have an Entry which looses focus when some other element on the page is tapped.

In MAUI this issue has been fixed in dotnet/maui#6246 two years ago. Unfortunately the code which causes the problem is still present in https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.Android/PlatformRenderer.cs
Is it possible to backport that from MAUI to XF or did you already cease to make any changes?

Steps to Reproduce

  1. Add an Entry and a Label with TapGestureRecognizer (I didn't test with a Button) to a page
  2. I even set all Android Views but the Editors renderer to Focusable=false;FocusableInTouchMode=false;
  3. focus the Entry and tap the Label

Expected Behavior

The Entry keeps its focus and the soft keyboard remains shown.

Actual Behavior

The PlatformRenderer calls ClearFocus() and thus the soft keyboard is hidden - although no other view has the focus. On the Android side at this point Activity.CurrentFocus returns null.

Basic Information

  • Version with issue: 5.0.0.2622
  • Platform Target Frameworks:
    • Android: 13.0

Workaround

I did not find a workaround. If you know how I can prevent that without XF needing to change, I'm happy to use that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions