Skip to content
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

Fix for Spinner not disappearing in RefreshView #16997

Closed

Conversation

dustin-wojciechowski
Copy link
Contributor

@dustin-wojciechowski dustin-wojciechowski commented Aug 25, 2023

Description of Change

After some investigation, I found the PR where the spinner in Refresh Views would not disappear after IsRefreshing was set to false. After looking at the PR, I believe that the IsRefreshing property isn't utilizing the correct SetValue method.

Before (fast forward with scrubber to see the spinner, otherwise webm player won't show it):
before.webm
After:
after.webm

There still seems to be a case where the spinner's outline remains but the inner animation disappears, and it predates the Specificity PR by almost a year (yet was fixed at some later point, apparently). I haven't been able to reproduce that particular issue, and want to test some more, but figure I'd get some feedback on this one.

Issues Fixed

Fixes #16910

…for spinner to disappear once IsRefreshing is set to false.
@dustin-wojciechowski
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@dustin-wojciechowski dustin-wojciechowski added i/regression This issue described a confirmed regression on a currently supported version area-controls-refreshview RefreshView labels Aug 25, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Aug 25, 2023
@dustin-wojciechowski dustin-wojciechowski marked this pull request as ready for review August 25, 2023 15:59
@dustin-wojciechowski dustin-wojciechowski requested a review from a team as a code owner August 25, 2023 15:59
jknaudt21
jknaudt21 previously approved these changes Aug 26, 2023
Copy link
Contributor

@jknaudt21 jknaudt21 left a comment

Choose a reason for hiding this comment

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

Tested locally and works!

@jknaudt21
Copy link
Contributor

jknaudt21 commented Aug 26, 2023

Regarding the spinner persisting locally, the issue still persists. To repro it, you have to drag down to start a refresh, and then (while still holding/tapping), drag up. The icon will remain stuck there. You can repro using the Controls.Sample app

Scrolly

@PureWeen
Copy link
Member

Related #16654

@@ -62,7 +62,7 @@ static object OnIsRefreshingPropertyCoerced(BindableObject bindable, object valu
public bool IsRefreshing
{
get { return (bool)GetValue(IsRefreshingProperty); }
set { SetValue(IsRefreshingProperty, value); }
set { SetValue(IsRefreshingProperty, value, SetterSpecificity.FromHandler); }
Copy link
Member

Choose a reason for hiding this comment

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

RefreshView isn't a Handler, so is this correct? @PureWeen does this actually need to go somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See Shane's comment here: #16997 (comment)

@samhouts samhouts added this to the .NET 8 GA milestone Aug 28, 2023
@dustin-wojciechowski
Copy link
Contributor Author

@jknaudt21 Thanks for reproducing that! I was able to get the same result with your video.

I do think that is related to a different issue, as described in #8926. This one at least will fix the issue of the spinner lingering past the refresh period.

@@ -62,7 +62,7 @@ static object OnIsRefreshingPropertyCoerced(BindableObject bindable, object valu
public bool IsRefreshing
{
get { return (bool)GetValue(IsRefreshingProperty); }
set { SetValue(IsRefreshingProperty, value); }
set { SetValue(IsRefreshingProperty, value, SetterSpecificity.FromHandler); }
Copy link
Member

Choose a reason for hiding this comment

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

There are a few scenarios of this that we are currently fixing.

Use an explicit interface to use a different SetterSpecificity for values coming from the handler.

https://github.com/dotnet/maui/pull/17036/files#diff-a636f91eba00da8fba0f0c86b5ec4274498294234e5597180eddf1fae6f5116bR269-R273

Copy link
Contributor

Choose a reason for hiding this comment

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

this is wrong. the Handler should set the BP directly, not the c# property, with the right specificity

…o changed Refreshview.IsRefreshing's setter to use SetterSpecificity.FromBinding (This caused issue when hitting toggle button in samples app)
@dustin-wojciechowski
Copy link
Contributor Author

@PureWeen I did still have to set the SetterSpecificity to "FromBinding" in the setter of RefreshView.IsRefreshing to get this to work correctly. Let me know if that is the correct approach, still trying to understand SetterSpecificity better.

@PureWeen PureWeen closed this Aug 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-refreshview RefreshView i/regression This issue described a confirmed regression on a currently supported version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[regression/8.0.0-preview.7.8842] - RefreshView does not hide spinner when IsRefreshing set to false.
7 participants