Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

ASTableNode will scroll to the top after insert rows #3348

@IvanChan

Description

@IvanChan

AsdkDEMO.zip

Very simple demo

  1. load some data, like from 40 - 100
  2. and then insert rows at the beginning, 0- 39
  3. the ASTableNode just jump to the top after the insertion

The insertion code like below, I try to scroll after insertion, in demo seems ok, but my project got a much more complicated cell & safeAreaInset, its totally disaster

// Table scroll to the top after insert
    self.tableNode.insertRows(at: newIndexPaths, with: .none)

// This workaround looks ok just because the cell is simple in layout & rendering
     self.tableNode.performBatch(animated: false, updates: {
          self.tableNode.insertRows(at: newIndexPaths, with: .none)
      }, completion: { (finished) in
          self.tableNode.scrollToRow(at: newIndexPaths.last!, at: .top, animated: false)
      })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions