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

[Bug] Entry looses focus #15870

Open
MichaelRumpler opened this issue Feb 29, 2024 · 0 comments
Open

[Bug] Entry looses focus #15870

MichaelRumpler opened this issue Feb 29, 2024 · 0 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@MichaelRumpler
Copy link
Contributor

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.

@MichaelRumpler MichaelRumpler added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant