Skip to content

Improper Insert Behavior on ListView for Windows #22393

@john-hollander

Description

@john-hollander

Description

On Windows, with a ListView tied to an ObservableCollection, if an item is inserted in between two items, sometimes you end up with the display showing two items with the inserted value instead of two separate items. For example if you add "Test 1" then "Test 3", and then insert "Test 2" between the two items. The ListView will show:

Test 1
Test 2
Test 2

instead of what it should show:

Test 1
Test 2
Test 3

The ObservableCollection does have the items in the proper order, but the display is wrong.

Steps to Reproduce

(See the repro project)

  1. Create a MAUI app.
  2. Add a ListView to the main page.
  3. Tie the ListView to an ObservableCollection.
  4. Add a couple of items.
  5. Insert 1 item between the two items.

Link to public reproduction project repository

https://github.com/john-hollander/Maui-Tests/tree/master/ListViewInsertTest

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

windows10.0.19041.0

Did you find any workaround?

It works properly with a CollectionView, but the CollectionView doesn't support the RowHeight property that I need.

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions