New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableView animating incorrectly when updating TableSection/TextCell #5198

Open
TimLariviere opened this Issue Feb 11, 2019 · 3 comments

Comments

Projects
2 participants
@TimLariviere
Copy link

TimLariviere commented Feb 11, 2019

Description

While UWP is not affected by the issue #5197, it animates incorrectly in the case we replaced the default TableRoot by our own.

Steps to Reproduce

  1. Create a new Xamarin.Forms project
  2. Set the following content in MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TableViewAnimationIssue"
             x:Class="TableViewAnimationIssue.MainPage">

    <StackLayout Padding="10">
        <Label Text="Bad" />
        <TableView x:Name="TableViewBad" Intent="Form" />
        <Label Text="Good" />
        <TableView x:Name="TableViewGood" Intent="Form" />
        <Button x:Name="Increment" Text="Increment" />
    </StackLayout>

</ContentPage>
  1. Set the following in MainPage.xaml.cs
using System;
using Xamarin.Forms;

namespace TableViewAnimationIssue
{
    public partial class MainPage : ContentPage
    {
        public int _count = 0;
        private TableSection _sectionBad;
        private TableSection _sectionGood;
        private TextCell _cellBad;
        private TextCell _cellGood;

        public MainPage()
        {
            InitializeComponent();

            _sectionBad = new TableSection("0");
            _sectionGood = new TableSection("0");
            _cellBad = new TextCell { Text = "0" };
            _cellGood = new TextCell { Text = "0" };

            var sectionBad2 = new TableSection("Text");
            var cellBad2 = new TextCell { Text = "Text" };
            var sectionGood2 = new TableSection("Text");
            var cellGood2 = new TextCell { Text = "Text" };

            _sectionBad.Add(_cellBad);
            sectionBad2.Add(cellBad2);
            TableViewBad.Root = new TableRoot { _sectionBad, sectionBad2 };

            _sectionGood.Add(_cellGood);
            sectionGood2.Add(cellGood2);
            TableViewGood.Root.Add(_sectionGood);
            TableViewGood.Root.Add(sectionGood2);

            Increment.Clicked += Increment_Clicked;
        }

        private void Increment_Clicked(object sender, EventArgs e)
        {
            _count++;

            _sectionBad.Title = _count.ToString();
            _sectionGood.Title = _count.ToString();

            _cellBad.Text = _count.ToString();
            _cellGood.Text = _count.ToString();
        }
    }
}

Expected Behavior

The UI updates without playing an entrance animation on the whole TableView.

Actual Behavior

The UI updates and plays an entrance animation on the whole TableView.

Basic Information

  • Version with issue: At least 3.4.0.1008975, up to 3.5.0.129452
  • Platform Target Frameworks: UWP (others are currently impacted by issue #5197 which prevents this issue)
    • UWP: 16299

Screenshots

tablesectionuwpissue

Reproduction Link

https://github.com/TimLariviere/XFIssueRepros/tree/master/TableViewAnimationIssue

@samhouts

This comment has been minimized.

Copy link
Member

samhouts commented Feb 12, 2019

Duplicate of #2813

@samhouts samhouts marked this as a duplicate of #2813 Feb 12, 2019

@samhouts samhouts closed this Feb 12, 2019

Triage automation moved this from New to Closed Feb 12, 2019

@TimLariviere

This comment has been minimized.

Copy link
Author

TimLariviere commented Feb 12, 2019

@samhouts I fail to see why it's a duplicate?
In this issue, it's not scrolling down. It's playing an animation like if the whole collection was replaced.

And this occurs only in one scenario.
If we reuse the default TableRoot created by TableView, it's fine and doesn't play the animation.

@samhouts

This comment has been minimized.

Copy link
Member

samhouts commented Feb 12, 2019

@TimLariviere Thank you! I think it might have a very similar root cause, and it is likely UWP's native behavior, but I will reopen it for further investigation.

@samhouts samhouts reopened this Feb 12, 2019

Triage automation moved this from Closed to New Feb 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment