Created attachment 13439 [details]
When using a ListView that contains ViewCells with an Entry, selecting through the Entry controls will fire off a cycle of several FocusChange events before the destination cell is focused.
I was able to reproduce the issue on both Forms 1.5.0 and 1.5.1-pre2.
Application output: https://gist.github.com/jimmgarrido/2d239d227f674c7acc4e
### Steps to Reproduce
1. Run the attached solution on Android 5.0+
2. Select “John”
3. Select “James”
4. Select” Mary”
### Actual Results
In the application output, you will see that the app goest through several Focus changed cycles between the selected and previously selected cell until it stays focused on the selected one.
### Expected Results
FocusChanged is fired on the selected and previously selected cell just once.
### Environment Info
=== Xamarin Studio ===
Version 5.9.7 (build 22)
Installation UUID: 94ce5106-6a72-4691-b34e-cd5857b1db66
Mono 4.0.4 ((detached/d481017)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400040004
=== Apple Developer Tools ===
Xcode 7.0 (8227)
=== Xamarin.Android ===
Version: 188.8.131.52 (Business Edition)
Android SDK: /Users/jimmygarrido/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Xamarin.iOS ===
Version: 184.108.40.206 (Business Edition)
Build date: 2015-09-25 18:08:44-0400
=== Xamarin.Mac ===
Version: 220.127.116.11 (Business Edition)
=== Build Information ===
Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536
=== Operating System ===
Mac OS X 10.11.0
Darwin Jimmys-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
Wed Aug 26 16:57:32 PDT 2015
The FocusChange cycle is also causing the Page to go through several Layout cycles as well, which causes performance issues on complex pages.
The issue is also present in the 1.5.2-pre1 release.
I have found this bug too.
I was working on a custom binding of an entry, and I need the unfocused event to make some work...
for Entry outside the listview, it works well...
for Entry inside listview, the unfocus event is called multiple times, even if when you are just typing inside the entry
because is quite urgent for me, do you know when this bug will be fixed?
Temporar solution might be to use Entry inside ScrollView and not ListView. This will solve focus issue, but you will have to deal all the list logic by yourself.
This is still a problem in forms 18.104.22.16829 and it is crippling some of the input validation we are trying to accomplish.
We would appreciate if this issue could get some attention.
This bug is not present when you upgrade to FormsAppCompatActivity.
@Michael Using FormsAppCompatActivity didn't help me. Focus still going crazy after switching from one entry to other.
@Michael We discovered this issue after we had already upgraded to using the FormsAppCompatActivity. I can provide a reproduction case if necessary.
Still occurring on 22.214.171.124-nightly
Also have the same problem.
Posted workaround on StackOverflow helped me. http://stackoverflow.com/questions/42018962/entry-control-focus-unfocus-event-triggering-randomly-inside-listview-in-xamarin
*** Bug 51807 has been marked as a duplicate of this bug. ***
Still occurring on 126.96.36.1999-pre2
Still occurring on 188.8.131.525-pre3
Still occurring on 184.108.40.206203.
Just to clarify, the stackoverflow's workaround don't work because generate some situations where the page layout not refresh since user input (In my case when i add data to and empty ListView), and that's obviously a problem because user can see unupdated data. I'm trying to find a way to force relayout manually, but a new workaroud/fixed release is nedded/appreciated :)