-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add IsRefreshEnabled Property and Platform-Consistent IsEnabled Semantics to RefreshView #30692
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
Conversation
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Android.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs
Outdated
Show resolved
Hide resolved
d329ca7 to
c3ba804
Compare
9e2530b to
f484ee2
Compare
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.
Pull Request Overview
This PR introduces the IsRefreshEnabled property to RefreshView and standardizes IsEnabled behavior across all platforms. The new property provides granular control over the pull-to-refresh gesture while keeping child controls interactive, addressing inconsistent platform behaviors that were breaking Blazor Hybrid apps and other scenarios.
- Adds
IsRefreshEnabledproperty for granular refresh control - Standardizes
IsEnabledbehavior to disable entire view tree on all platforms - Updates platform handlers to support both properties consistently
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Core/src/Core/IRefreshView.cs |
Adds IsRefreshEnabled property to interface with conditional compilation support |
src/Core/src/Handlers/RefreshView/RefreshViewHandler.cs |
Maps new IsRefreshEnabled property to platform handlers |
src/Core/src/Handlers/RefreshView/RefreshViewHandler.*.cs |
Platform-specific implementations for IsRefreshEnabled mapping |
src/Core/src/Platform/iOS/MauiRefreshView.cs |
iOS platform implementation with new UpdateIsRefreshEnabled method |
src/Core/src/Platform/Android/MauiSwipeRefreshLayout.cs |
Android platform implementation with RefreshEnabled property |
src/Controls/src/Core/RefreshView/RefreshView.cs |
Core RefreshView implementation with new property and coercion logic |
src/Controls/tests/Core.UnitTests/RefreshViewTests.cs |
Comprehensive unit tests for new functionality |
src/Controls/tests/DeviceTests/Elements/RefreshView/RefreshViewTests.cs |
Device-level tests for RefreshView behavior |
src/Controls/tests/TestCases.HostApp/Issues/Issue30690.cs |
UI test page for manual and automated testing |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs |
Automated UI tests for cross-platform behavior validation |
| Multiple PublicAPI.Unshipped.txt files | API surface documentation updates |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
f484ee2 to
f974b43
Compare
|
/reabase |
f974b43 to
506688b
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
f9f7036 to
1282af0
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
UI tests do not support scroll up: #31216
b99782b to
d0975a6
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Failing tests doesn't seem related, saw it failing in other PR s |
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!
Summary
This PR introduces the
IsRefreshEnabledproperty toRefreshViewand ensures consistentIsEnabledbehavior across all platforms, addressing multiple community pain points where disabling RefreshView had inconsistent effects on child controls.Problem
Currently, setting
IsEnabled=falseon RefreshView behaves inconsistently across platforms:This creates blocking issues for Blazor Hybrid apps and other scenarios where developers need granular control over refresh behavior.
Solution
1. New
IsRefreshEnabledPropertyAdded a new property that provides granular control over just the pull-to-refresh gesture:
2. Consistent
IsEnabledBehaviorMade
IsEnabledbehavior consistent across all platforms - when set tofalse, it now disables the entire view tree on all platforms:Key Changes
IsRefreshEnabledproperty toIRefreshViewinterface andRefreshViewclassIsRefreshing = truewhen eitherIsEnabledorIsRefreshEnabledis falseIsEnabled = falsefor consistencyUsage Examples
Disable refresh during login (keep form interactive)
Disable everything during maintenance
Testing
Breaking Changes
None - This is a purely additive change. Existing code continues to work exactly as before, but now with consistent behavior across platforms.
Migration Guide
For developers who were relying on platform-specific
IsEnabledbehavior:Fixes #30690
Fixes #28361
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.