lepoco / lepoco/wpfui

ProgressRing: Indeterminate ProgressRing being hidden and shown multiple times makes spinner jump

Open
#1,348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.