Bug 52684 - UWP: Updating items in listview causes listview to not remember position after navigation
Summary: UWP: Updating items in listview causes listview to not remember position afte...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-02-22 19:37 UTC by Paul Brenner
Modified: 2017-06-22 01:18 UTC (History)
6 users (show)

Tags: listview position disappear ac uwp
Is this bug a regression?: ---
Last known good build:


Attachments
Sample showing issue (574.26 KB, application/zip)
2017-02-22 19:37 UTC, Paul Brenner
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 for Bug 52684 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Paul Brenner 2017-02-22 19:37:49 UTC
Created attachment 19908 [details]
Sample showing issue

In the sample app I have a listview with 20 items. When you tap an item, it updates the item and then navigates to a different page. When you navigate back, the listview is positioned back to the top, regardless of where the item you tapped on was in the list.

Tested on 2.3.3.180. Note this does not happen on iOS or Android.
Comment 1 Paul DiPietro [MSFT] 2017-02-22 20:00:11 UTC
Thanks for the reproduction. For some reason I can actually have the list disappear completely if the window is vertically compressed and I scroll down and then navigate back. Setting this to confirmed for now and wondering (at a glance) if it's related to 48682.
Comment 2 Chris King 2017-03-14 16:37:51 UTC
True that the behavior is different but I'm wondering if the cost converging the behavior is worth the price in maintenance. Right now, I'm inclined to say that if a ListView's contents are replaced the ListView's position may be at zero or at an offset. 

Consider the case with uneven rows where item n is visible which is m pixels down from item 0. When the ItemsSource is replaced should the ListView keep item n visible or should it be m pixels down even though n might not be visible due to the new distribution of row heights? I could see arguments either way. Instead of putting a stake in the ground I'd prefer to leave the behavior undefined and off the work around of updating the individual items with new data. Is there a reason that is onerous in your more scenario? 

I'll also circle back and see what the team thinks.
Comment 3 Chris King 2017-03-16 14:29:45 UTC
Paul, please let us know if you're unable to work around by updating items in the list as opposed to replacing them.
Comment 4 Paul Brenner 2017-03-17 18:20:43 UTC
@Chris King, We can, though I feel like this should get fixed since that is just a workaround.
Comment 5 Mike 2017-04-05 14:08:24 UTC
The problem is not about the ListView, it's about the page design, Currently the page will dispose the old page when navigate the new page, that's why when you back the old think not keep the original status(basically it will initial again).


See more:
https://bugzilla.xamarin.com/show_bug.cgi?id=41975
https://bugzilla.xamarin.com/show_bug.cgi?id=48682
https://bugzilla.xamarin.com/show_bug.cgi?id=41975
https://bugzilla.xamarin.com/show_bug.cgi?id=46856
https://github.com/xamarin/Xamarin.Forms/pull/647
Comment 6 Rui Marinho 2017-06-20 18:22:36 UTC
We should make UWP behavior the same as iOS and Android