Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Bug] Focus issue with Entry control in Xamarin.Forms 5.0.0.2515 in Android OS 8.1

Open vmarak opened this issue 2 years ago • 8 comments

Description When using Entry control in Android OS version 8.1 with Xamarin.Forms 5.0.0.2515, facing the following focus issues. These issues are not observed in OS 10, OS 11 and OS 12

  1. If there are multiple entry fields on the screen, then always focus is coming on to the first entry field and unable to switch to next entry field, We have to manually tap on to the next entry field to get focus.
  2. After entering text in the next entry field, focus is going to the previous entry field of that screen.
  3. Sometimes while entering text into the entry field virtual keyboard is not showing up.
  4. When there is only one Entry control, by default the focus is always coming in to the entry field, and due to this Focused and Unfocused event are continuously hitting and going into the infinite loop.

Steps to Reproduce Enter a value in the first Entry control and tap done on keypad.

Expected Behavior Next Entry control should get the focus

Actual Behavior Focus is in the same control.

Basic Information -Version with issue: 5.0.0.2515 -Last known good version: 5.0.0.2196 -Platform Target Frameworks: Android: 8.1 NuGet Packages: NETStandard.Library Xamarin.Essentials Xamarin.Forms Affected Devices: Zebra TC77

Reproduction Link https://github.com/vmarak/SampleApp

Workaround Downgraded to Xamarin Forms to 5.0.0.2196

vmarak avatar Oct 26 '22 14:10 vmarak

+1

We are also experiencing this issue on Android 7.1 and 7.1.2 devices.

phunkeler avatar Nov 04 '22 01:11 phunkeler

We are also experiencing the same issue on a Samsung Galaxy Tab A (2016) running Android 8.1.

In our case the hardware back button also stops working. The Unfocused event of the entry is triggered, but immediatly after regains focus and the Focused event is triggered, instead of navigating away from the current page.

Initially tested on 5.0.0.2515 but this issue also appears in 5.0.0.2478. Downgrading to Xamarin.Forms 5.0.0.2401 however was enough to fix this issue for now.

wodyy666 avatar Dec 02 '22 16:12 wodyy666

Did some further testing and can report that adding the following to my MainActivity does NOT solve this issue:

Forms.SetFlags("AccessibilityExperimental");
Forms.SetFlags("DisableAppCompatRenderers");
Forms.SetFlags("UseLegacyRenderers");

wodyy666 avatar Dec 02 '22 16:12 wodyy666

Did some further testing and can report that adding the following to my MainActivity does NOT solve this issue:

Forms.SetFlags("AccessibilityExperimental");
Forms.SetFlags("DisableAppCompatRenderers");
Forms.SetFlags("UseLegacyRenderers");

Try this one: Forms.SetFlags("Disable_Accessibility_Experimental");

AndriiKha avatar Dec 08 '22 11:12 AndriiKha

Thank you! Adding "Disable_Accessibility_Experimental" does resolve my issue.

The release notes for 5.0.0 Service Release 11 should be updated if possible. Currently they read:

If you want to disable the new functionality call Forms.SetFlags("AccessibilityExperimental"); before the Forms.Init(); call in your MainActivity on Android.

So change "AccessibilityExperimental" to "Disable_Accessibility_Experimental"

wodyy666 avatar Dec 08 '22 13:12 wodyy666

I have added "Disable_Accessibility_Experimental" to the MainActivity but I cannot set the focus to any control on the page. I would like the first control to have focus. It works fine with iOS but not Android

sisaacks avatar May 08 '23 17:05 sisaacks

Did some further testing and can report that adding the following to my MainActivity does NOT solve this issue:

Forms.SetFlags("AccessibilityExperimental");
Forms.SetFlags("DisableAppCompatRenderers");
Forms.SetFlags("UseLegacyRenderers");

Try this one: Forms.SetFlags("Disable_Accessibility_Experimental");

Dude, you are saving my life. Do this and voila, the problem perfectly solved. Believe me or not, this simple answer will soon contributing on helping millions of people in my country.

Keep up the good deeds dude 😄 👍

jatmika-com avatar Jun 23 '23 11:06 jatmika-com

Disable_Accessibility_Experiment

I've been in the same situation for days, I'm creating an app for Android TV and the focus only appears if I double-click the TAB key, I've done everything and nothing works

brunotrevisan avatar Oct 14 '23 12:10 brunotrevisan