ProgressRing: Indeterminate ProgressRing being hidden and shown multiple times makes spinner jump
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
If a ProgressRing is hidden and shown multiple times, then the spinner starts to jump every 2 seconds.
Interestingly, it effects all ProgressRing instances on the page which are always visible!
To Reproduce
<CheckBox IsChecked="{Binding IsProgressRingVisible}">Toggle</CheckBox>
<ui:ProgressRing Visibility="{Binding IsProgressRingVisible, Converter={StaticResource BoolToVisibilityConverter}}" IsIndeterminate="True" />
Expected behavior
It should not start jumping.
Screenshots
No response
OS version
Windows 10 22H2 19045.5371
.NET version
.NET 4.7.2
WPF-UI NuGet version
4.0.0
Additional context
Fix
The From is missing from the first DoubleAnimation. After adding this, you can toggle as many times you want and it will not start jumping around.
In the control template, replace this:
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="Arc"
Storyboard.TargetProperty="(Canvas.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:2" />
with this
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="Arc"
Storyboard.TargetProperty="(Canvas.RenderTransform).(RotateTransform.Angle)"
From="0"
To="360"
Duration="0:0:2" />
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ProgressRing control template and find the first DoubleAnimation targeting Arc's RotateTransform.Angle. Confirm the indeterminate animation currently specifies To="360" without From, then update it to start at 0 and verify that repeatedly toggling Visibility no longer makes visible ProgressRing instances jump.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100