dotnet / dotnet/maui

Changing one CollectionView's ItemSpacing changes another CollectionView's ItemSpacing as well.

Open
#29,696 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-controls-collectionview collectionview-cv2 platform/android platform/ios platform/macos platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

Description

If I define two CollectionViews without explicitly setting their ItemsLayout, and then change the ItemSpacing of the first CollectionView at runtime, the ItemSpacing of the second CollectionView also changes.

https://github.com/user-attachments/assets/3ddae493-74f4-4694-bb8c-3cea23437e25

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/bhavanesh2001/CollectionViewItemsLayoutBug

Version with bug

9.0.70 SR7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked public reproduction project and reproduce the behavior with two CollectionViews that use their default ItemsLayout. Trace the runtime ItemSpacing change and verify that the two controls retain independent spacing on the affected platforms; done means changing one no longer changes the other.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.