KEMBAR78
[Android] Fix for IndicatorView remains interactive even when IsEnabled="False" by HarishwaranVijayakumar · Pull Request #31457 · dotnet/maui · GitHub
Skip to content

Conversation

@HarishwaranVijayakumar
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!

Issue Details

  • Setting IsEnabled="False" on an IndicatorView does not properly disable its interactivity. The indicator dots remain clickable and respond to user interactions.

Root Cause of the issue

  • The Android implementation of the IndicatorView (MauiPageControl) creates click listeners for each indicator dot (ImageView) but these click listeners do not check the IsEnabled state of the parent IndicatorView before processing click events. The click listeners are created once during initialization and continue to respond to clicks regardless of the enabled state.

Description of Change

  • Updated MauiPageControl.cs to ensure that indicator taps are only processed when IndicatorView.IsEnabled is true, preventing user interaction when disabled.

Issues Fixed

Fixes #31063

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - iOS
  • - Mac

Output

Before Fix After Fix
Before.mov
After.mov

@dotnet-policy-service
Copy link
Contributor

Hey there @@HarishwaranVijayakumar! 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 Sep 2, 2025
@HarishwaranVijayakumar HarishwaranVijayakumar marked this pull request as ready for review September 2, 2025 13:09
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 13:09
@HarishwaranVijayakumar HarishwaranVijayakumar requested a review from a team as a code owner September 2, 2025 13:09
@sheiksyedm sheiksyedm added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Sep 2, 2025
Copy link
Contributor

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 an issue where IndicatorView on Android remains interactive even when IsEnabled is set to False. The problem was that click listeners for indicator dots were created during initialization and continued to respond to clicks regardless of the parent IndicatorView's enabled state.

  • Updates the Android implementation to check IsEnabled before processing indicator taps
  • Adds UI test infrastructure to validate the fix behavior
  • Provides test cases for both HostApp demonstration and automated testing

Reviewed Changes

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

File Description
src/Core/src/Platform/Android/MauiPageControl.cs Adds IsEnabled check in click listener to prevent interaction when disabled
src/Controls/tests/TestCases.HostApp/Issues/Issue31063.cs Creates HostApp UI test page demonstrating disabled IndicatorView behavior
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31063.cs Implements NUnit test to validate IsEnabled property is respected

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -0,0 +1,25 @@
#if TEST_FAILS_ON_WINDOWS // IndicatorView UI automation not working on Windows
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you create a new issue related with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz, I’ve created an issue for this #31666

@rmarinho rmarinho changed the base branch from main to inflight/current September 19, 2025 08:38
@rmarinho rmarinho merged commit 07968eb into dotnet:inflight/current Sep 19, 2025
80 checks passed
PureWeen pushed a commit that referenced this pull request Oct 6, 2025
…ed="False" (#31457)

* Fix for IndicatorView IsEnabled

* Removed Private Keyword

* Test restricted on windows

* Remove unwanted file

* Modified the fix

* Modify fix
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] IndicatorView remains interactive even when IsEnabled="False"

4 participants