dotnet / dotnet/maui

[Windows] ScrollPosition changes while inserting an item into CollectionView.

Open
#28,006 1 comment 0 reactions 0 assignees View on GitHub
area-controls-collectionview partner/syncfusion platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

When tapping the "Add Item Above" button on the Windows platform, the CollectionView scrolls to the top of the view. This behavior does not occur on other platforms, where the list remains in place and does not automatically scroll to the top when a new item is added.

Windows:

https://github.com/user-attachments/assets/8e3eb56e-714d-457b-9fe5-d601e87136ff

Android :

https://github.com/user-attachments/assets/0aab6d1a-343f-49e9-9ab5-8059e44c111f

### Steps to Reproduce

1. Launch the application on the Windows platform - [UpdatingScrollMode.zip](https://github.com/user-attachments/files/18944372/UpdatingScrollMode.zip)
2. Ensure there is a populated CollectionView with items.
3. Tap the "Add Item Above" button.
4. Observe the behavior of the CollectionView.
5. Notice that the list automatically scrolls to the top after adding an item, which doesn't happen on other platforms.

### Expected Behavior:
The "Add Item Above" button should add an item to the list without causing the CollectionView to scroll to the top on any platform. The list should remain at the current scroll position when the item is added.

### Actual Behavior:
On the Windows platform, tapping the "Add Item Above" button causes the CollectionView to scroll to the top, while on other platforms (such as Android and iOS), the list remains at the current position.

### Link to public reproduction project repository

_No response_

### Version with bug

9.0.40 SR4

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

_No response_

### Affected platforms

Windows

### Affected platform versions

_No response_

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start with the attached UpdatingScrollMode.zip reproduction and run it on Windows, comparing the CollectionView behavior after using "Add Item Above" with Android or iOS. Trace the Windows CollectionView insertion and scroll-position handling; done means adding an item above preserves the current scroll position instead of returning to the top.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.