-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix for IndicatorView remains interactive even when IsEnabled="False" #31457
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
rmarinho
merged 6 commits into
dotnet:inflight/current
from
HarishwaranVijayakumar:fix-31063
Sep 19, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0f4bb0a
Fix for IndicatorView IsEnabled
HarishwaranVijayakumar dccf8f0
Removed Private Keyword
HarishwaranVijayakumar 6367575
Test restricted on windows
HarishwaranVijayakumar b25ad54
Remove unwanted file
HarishwaranVijayakumar 620ccf2
Modified the fix
HarishwaranVijayakumar 2a355b8
Modify fix
HarishwaranVijayakumar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 31063, "IndicatorView remains interactive even when IsEnabled is False", PlatformAffected.Android)] | ||
| public partial class Issue31063 : ContentPage | ||
| { | ||
| CarouselView _carouselView; | ||
| IndicatorView _indicatorView; | ||
|
|
||
| public Issue31063() | ||
| { | ||
| // Create StackLayout | ||
| var stackLayout = new StackLayout | ||
| { | ||
| Padding = 20, | ||
| Spacing = 20 | ||
| }; | ||
|
|
||
| // CarouselView | ||
| _carouselView = new CarouselView | ||
| { | ||
| HeightRequest = 200, | ||
| ItemsSource = new string[] | ||
| { | ||
| "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" | ||
| }, | ||
| ItemTemplate = new DataTemplate(() => | ||
| { | ||
| var label = new Label | ||
| { | ||
| FontSize = 30, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| VerticalOptions = LayoutOptions.Center, | ||
| Padding = 20 | ||
| }; | ||
| label.SetBinding(Label.TextProperty, "."); | ||
| return label; | ||
| }) | ||
| }; | ||
|
|
||
| // IndicatorView | ||
| _indicatorView = new IndicatorView | ||
| { | ||
| AutomationId = "TestIndicatorView", | ||
| IndicatorColor = Colors.LightGray, | ||
| SelectedIndicatorColor = Colors.Blue, | ||
| IndicatorSize = 25, | ||
| IsEnabled = false, | ||
| HorizontalOptions = LayoutOptions.Center | ||
| }; | ||
|
|
||
| // Bind Indicator to Carousel | ||
| _indicatorView.SetBinding(IndicatorView.ItemsSourceProperty, new Binding | ||
| { | ||
| Source = _carouselView, | ||
| Path = "ItemsSource" | ||
| }); | ||
|
|
||
| _indicatorView.SetBinding(IndicatorView.PositionProperty, new Binding | ||
| { | ||
| Source = _carouselView, | ||
| Path = "Position", | ||
| Mode = BindingMode.TwoWay | ||
| }); | ||
|
|
||
| // Add children | ||
| stackLayout.Children.Add(_carouselView); | ||
| stackLayout.Children.Add(_indicatorView); | ||
|
|
||
| // Set Content | ||
| Content = stackLayout; | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31063.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #if TEST_FAILS_ON_WINDOWS // IndicatorView UI automation not working on Windows | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue31063 : _IssuesUITest | ||
| { | ||
| public override string Issue => "IndicatorView remains interactive even when IsEnabled is False"; | ||
|
|
||
| public Issue31063(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.IndicatorView)] | ||
| public void IndicatorViewShouldRespectIsEnabledProperty() | ||
| { | ||
| App.WaitForElement("TestIndicatorView"); | ||
| App.Tap("TestIndicatorView"); | ||
| App.WaitForElement("Item 1"); | ||
| } | ||
| } | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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