Skip to content

[Windows] Fix for CarouselView IsSwipeEnabled=False Prevents Visual Navigation #29286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025

Conversation

SubhikshaSf4851
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

RootCause:

Setting IsSwipeEnabled = false disables scrollbar visibility, which prevents the CarouselView from scrolling when position changed programmatically.

Description of Change:

Using hidden for the scrollbar visibility instead of disabled resolves the issue and enables programmatic scrolling to function correctly.

Issues Fixed

Fixes #29216

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
Issue29216BeforeFix.mp4
Issue29216AfterFix.mp4

Copy link
Contributor

Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels May 2, 2025
@SubhikshaSf4851 SubhikshaSf4851 marked this pull request as ready for review May 2, 2025 11:45
@Copilot Copilot AI review requested due to automatic review settings May 2, 2025 11:45
@SubhikshaSf4851 SubhikshaSf4851 requested a review from a team as a code owner May 2, 2025 11:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where setting IsSwipeEnabled to false disables the visual scrollbar, preventing programmatic navigation in CarouselView. Key changes include updating scrollbar visibility to "Hidden" on Windows and adding corresponding tests to ensure the fix works across platforms.

  • Updated CarouselViewHandler.Windows.cs to use WScrollBarVisibility.Hidden instead of Disabled when IsSwipeEnabled is false.
  • Added a test for the issue in TestCases.Shared.Tests.
  • Updated TestCases.HostApp to host the revised CarouselView behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29216.cs Added test case to verify CarouselView scrolling behavior.
src/Controls/tests/TestCases.HostApp/Issues/Issue29216.cs Integrated test UI for CarouselView navigation.
src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs Modified scrollbar visibility handling to resolve the scrolling bug.

@jsuarezruiz jsuarezruiz added platform/windows area-controls-collectionview CollectionView, CarouselView, IndicatorView labels May 2, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes May 5, 2025
@PureWeen PureWeen changed the base branch from main to inflight/current May 5, 2025 16:54
@PureWeen PureWeen dismissed jsuarezruiz’s stale review May 5, 2025 16:54

The base branch was changed.

@PureWeen PureWeen merged commit 049d567 into dotnet:inflight/current May 5, 2025
77 checks passed
PureWeen pushed a commit that referenced this pull request May 5, 2025
…avigation (#29286)

* [Windows] Fix for Carousel View doesn't scroll programmatically

* Test case sample
PureWeen added a commit that referenced this pull request May 8, 2025
For more information about inflight process check
https://github.com/dotnet/maui/wiki/Inflight-Branch-Process

## .NET MAUI Release Notes - inflight/candidate

This document contains release notes for changes from main branch to
inflight/candidate branch.

### MAUI Product Fixes
* [iOS] Fix: FlyoutPage memory leak by @bhavanesh001 in
#28769
* [Windows] Fix for CarouselView IsSwipeEnabled=False Prevents Visual
Navigation by @SubhikshaSF4852 in
#29286
* [Windows] Fix for Argument Exception raised when the GetStringSize
method of ICanvas called with default font by @SyedAbdulAzeemSF4852 in
#29048
* Removed frame styles by @Vignesh-SF3580 in
#29222
* [Android] Fixed the CollectionView Header and Footer Do Not Align with
Horizontal ItemsLayout When EmptyView is Displayed by @Ahamed-Ali in
#28779
* Add global xmlns in template by @StephaneDelcroix in
#29203
* Fixed - On iOS GestureRecognizers don't work on Span in a Label, which
doesn't get IsVisible (=true) update from its parent by
@KarthikRajaKalaimani in #29024
* Fixed Footer not displayed at the Bottom When EmptyView in CV2 by
@Dhivya-SF4094 in #28681
* Fixed typo in Connectivity.shared.cs by @corvinsz in
#29213

### Testing
* Re-enabled flaky UI test TextInEditorShouldScroll by
@NirmalKumarYuvaraj in #29167
* [Testing] Re-Enabled UI Test - Issue10222Test by @TamilarasanSF4853 in
#29226
* [Testing] Feature Matrix UITest Cases for CollectionView Selection
Feature by @LogishaSelvarajSF4525 in
#29165

### Dependency Updates
*No dependency updates in this release*

### Docs
*No documentation changes in this release*

### Housekeeping
*No housekeeping changes in this release*

## New Contributors
* @corvinsz made their first contribution in
#29213

**Full Changelog**:
main...inflight/candidate
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request May 9, 2025
…avigation (dotnet#29286)

* [Windows] Fix for Carousel View doesn't scroll programmatically

* Test case sample
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CarouselView IsSwipeEnabled=False Prevents Visual Navigation on Windows
3 participants