dotnet / dotnet/maui

CarouselView WidthRequest Not Working Correctly on Windows Platform

Open
#27,680 2 comments 0 reactions 0 assignees View on GitHub
area-controls-collectionview p/2 platform/windows t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

When using the CarouselView in .NET MAUI with a WidthRequest set for images, the images are not displayed as expected on the Windows platform. Despite the ItemsSource being set to a single item (e.g., new[] {1} ) multiple images are shown simultaneously. On other platforms like Android, iOS, and macOS, when the user scrolls through the CarouselView, multiple images are displayed as intended.
**Note**: While fixing this issue, enable the Issue21609 test case.
In Windows - Not Working
![Image](https://github.com/user-attachments/assets/18555014-69f3-4469-9607-58317fda2661)
In Android - Working fine

### Steps to Reproduce

1. [Issue21609.zip](https://github.com/user-attachments/files/18734904/Issue21609.zip)
2. Run the project on Windows.
3. Observe that all images are displayed openly in the CarouselView.
4. Run the same project on Android, iOS, or macOS, where only one image is shown at a time, and scrolling is enabled.

Expected Result:

On Windows, when using a CarouselView with a WidthRequest of 200, the carousel should display one image at a time, and users should be able to scroll through the images (just like on Android, iOS, and macOS).

Actual Result:

On Windows, all images in the CarouselView are shown at once, and no scrolling occurs.
On other platforms like Android, iOS, and macOS, the CarouselView shows only one image at a time, and scrolling allows the user to view additional images.

### Link to public reproduction project repository

_No response_

### Version with bug

9.0.30 SR3

### 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

Windows SDK 10.0.19041.0

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start by running the attached Issue21609 reproduction on Windows and compare CarouselView behavior with Android, iOS, or macOS. Enable the Issue21609 test case while investigating; done means WidthRequest=200 shows one image at a time and scrolling works on Windows, matching the stated expected result.

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.