Skip to content

Keyed lists and reordering of multiple children #2327

@WorldSEnder

Description

@WorldSEnder

Problem

The test case as shown in WorldSEnder@71dd160 should work.

Steps To Reproduce

  1. Render a list and swap the order of multiple, successive elements in the list.
  2. The elements will appear out of order

Environment:

  • Yew version: master

Analysis:
The rendering code in vlist::apply_keyed only moves a node if it appears out-of-order relative to the next element, when compared against the new incoming render order. This is wrong. When multiple children are moved, only the first (in render order) child that changes in the order is recognized as out-of-order and moved.

Probably introduced as part of #1555 .

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions