Bug 60720 - The ItemTapped event for a grouped ListView is not working as expected.
Summary: The ItemTapped event for a grouped ListView is not working as expected.
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.5.0
Hardware: PC Windows
: Highest normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 60711 60875 ()
Depends on:
Blocks:
 
Reported: 2017-11-16 15:20 UTC by josepen@microsoft.com
Modified: 2018-02-01 17:33 UTC (History)
20 users (show)

Tags: listview, item, null, ac, fr
Is this bug a regression?: Yes
Last known good build: 2.3.4.270


Attachments
Sample Repro (976.84 KB, application/x-zip-compressed)
2017-11-16 15:51 UTC, josepen@microsoft.com
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description josepen@microsoft.com 2017-11-16 15:20:11 UTC
The ItemTapped event for a grouped ListView is not working as expected. 

ItemTappedEventArgs.Group is populated as expected, however ItemTappedEventArgs.Item is null sometimes, and not the item expected for all items further down the list.

In the sample i got two lists inside a GroupList, in the first list I get a Null in the ItemTappedEventArgs.item when I click the first element of that list, on my second list I get that behaviour (get a Null in the ItemTappedEventArgs) when I clicked the second element of that second list…

I’m sending a complete solution (in attach) where this is replicable.
Comment 1 Paul DiPietro [MSFT] 2017-11-16 15:41:34 UTC
Attachment looks like it's missing unless you're still in the midst of doing so.
Comment 2 josepen@microsoft.com 2017-11-16 15:51:17 UTC
Created attachment 25739 [details]
Sample Repro
Comment 3 Paul DiPietro [MSFT] 2017-11-16 18:11:32 UTC
Thanks; seems like the "item is null" output is only occurring on UWP.
Comment 4 AlanLS 2017-11-16 22:29:24 UTC
Note: This is not only a first item issue. (but yes only UWP)

I am using MVVM method, catching a change to the list's SelectedItem;

When I select the first Item in a grouped list returns two selection changes, a null followed by the first item.

Any other item selection (ie I scroll down and make a selection), returns the item immediately before it in the list, followed by the correct selection.


I have not tested this scrolling up the list.
Comment 5 Brett Changus 2017-11-16 23:18:12 UTC
So is this still to be fixed in 2.5.1 as Rui Marinho mentioned a few weeks ago? A little guidance would be appreciated as this has been holding up our production for a couple months now.
Comment 6 squinn7 2017-11-17 22:12:40 UTC
I would like to report that we are running into this issue as well. The list view seems to be one index behind which causes the first item to be null and the reaming items to select the previous when clicked.

This issue has been holding up our whole production for awhile. The last safe version is 2.3.4 for windows list views and just because it only affects windows doesn't mean I can individually upgrade targets. 

I hope this issue is being taken seriously as I have not been able to try any of these new forms(2.4, 2.5)features because of this what seems like a minor bug which would be easy to fix. Alas, two major updates came it is not fixed.
Comment 7 Paul DiPietro [MSFT] 2017-11-20 19:38:00 UTC
*** Bug 60711 has been marked as a duplicate of this bug. ***
Comment 8 Edward Brey 2017-11-21 02:20:22 UTC
The problem also affects ListView.ItemSelected: SelectedItemChangedEventArgs.SelectedItem is null for the fist item in each group.
Comment 9 Tibo 2017-11-21 15:36:08 UTC
It sounds so difficult to make an ListView.ItemTapped working correctly. I'm sure all the Xamarin teams are really hard working on it since september (see 59718)... 
Do we have to tell all our clients working on Windows platform that they have to buy iPhones or Androids because UWP is no more an option?

By the way, the following code is a workaround, but I had to do this for all my lists. That just unbelievable, unacceptable and costing so many time for nothing!!!

//using Xamarin.Forms.PlatformConfiguration;
//using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;

_myListView.On<Windows>().SetSelectionMode(ListViewSelectionMode.Inaccessible);
Comment 10 Paul DiPietro [MSFT] 2017-11-27 17:52:52 UTC
*** Bug 60875 has been marked as a duplicate of this bug. ***
Comment 11 Ray Kelly 2017-11-27 22:35:21 UTC
ItemSelected is not working either in a grouped ListView.   It returns null for the first item and all items after that are off by the number in the groups in the list.   Absolute critical bug and makes our app unshipable.
Comment 12 brian 2017-11-27 23:07:56 UTC
I can confirm this behavior as well. And it is also critical for me.
Comment 13 Moltroon 2017-12-04 09:07:46 UTC
I confirm too. It's a critical problem for me too. 3000 users wait the new app but I am blocked...
Comment 14 ray 2017-12-15 08:52:56 UTC
This happens with UWP as well as RT (Windows 8.1).
We are also urgently waiting for a fix before we can deploy a new release.
Comment 15 David Ortinau [MSFT] 2017-12-20 01:53:27 UTC
Migrated to https://github.com/xamarin/Xamarin.Forms/issues/1439

Please subscribe to that issue for future updates.
Comment 16 Samantha Houts [MSFT] 2018-02-01 17:33:12 UTC
https://github.com/xamarin/Xamarin.Forms/pull/1499