Xamarin.Forms
Xamarin.Forms copied to clipboard
[Bug] Focus issue with Entry control in Xamarin.Forms 5.0.0.2515 in Android OS 8.1
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
- 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.
- After entering text in the next entry field, focus is going to the previous entry field of that screen.
- Sometimes while entering text into the entry field virtual keyboard is not showing up.
- 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
+1
We are also experiencing this issue on Android 7.1 and 7.1.2 devices.
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.
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");
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");
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"
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
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 😄 👍
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