xamarin/Xamarin.Forms

[Bug] [UWP] Adding a new item in Master-detail page causes the list to reload

Open

#8,695 opened on Nov 27, 2019

 (3 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/listviewe/3 :clock3:help wantedinactivep/UWPt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

The problem was originally reported on StackOverflow by Lordalcol.

When the default template of Master-detail page is created and user navigates to add a new item and saves it, the list first appears invisible and fades with a delay instead of just one new item being animated in. In contrast, when the Cancel button is tapped, the list does appear immediately.

Steps to Reproduce

  1. Create default master-detail XF app with UWP
  2. Launch
  3. Navigate to Add new item page
  4. Save item
  5. Notice the list fades in as a whole, with a visible delay
  6. Go to Add new item page
  7. Cancel
  8. See the list animates in immediately

See video demonstration

Also note that when the ItemsViewModel message subscription is changed to:

MessagingCenter.Subscribe<NewItemPage, Item>(this, "AddItem", async (obj, item) =>
{
    await Task.Delay(100); //added delay
    var newItem = item as Item;
    Items.Add(newItem);
    await DataStore.AddItemAsync(newItem);
});

The application works properly - when item is saved, the list appears immediately and only the new item is animated in - see video.

Expected Behavior

Only new item should animate.

Actual Behavior

Whole list fades in with a delay.

Basic Information

  • Version with issue: 4.3.0.991211
  • Last known good version: none
  • IDE: VS 2019.3.10
  • Platform Target Frameworks
    • UWP: 16299 - newer (does not work with any version)

Video

Contributor guide