Skip to content

[iOS]VerticalOffset Not Reset to Zero After Clearing ItemSource in CollectionView #26798

@devanathan-vaithiyanathan

Description

Description

VerticalOffset are not reset to 0 when ItemSource is cleared or items are removed. However, after adding items back to the ItemSource, the offset values update correctly when scrolling.

Steps to Reproduce

  1. Run the attached sample.
  2. Click the Fill button.
  3. Click the Empty button.
  4. Check the VerticalOffset value after clearing. It does not reset to zero.
  5. VerticalOffsetBug.zip

Expected: Offsets reset to 0 after clearing items from ItemSource.
Actual: Offsets retain old values when items are cleared or removed but update correctly after items are added back and scrolling occurs.

Screen.Recording.2024-12-24.at.3.21.59.PM.mov

Link to public reproduction project repository

No response

Version with bug

9.0.21 SR2.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

macOS, iOS

Affected platform versions

iOS 18.0, mac 15.1

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions