Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

ToggleSwitch knob resetting position a while after knob dragging is over (11.0.0-preview1)

Open appleneko2001 opened this issue 1 year ago • 5 comments

Describe the bug avaloniaUI allows you dragging knob of ToggleSwitch than click it since commit: 75c10992a9. It has worked properly before 11.0.0-preview1. There was a problem I observed is the knob always resetting to zero value when you complete the flow of dragging knob in any state. After some frames it corrects position instead of transitioning movement.

To Reproduce This can be done on any themes with ToggleSwitch knob dragging feature supported. Here I provide how I reproduced this glitch in official Avalonia Control Gallery Steps to reproduce the behavior:

  1. Go to 'ToggleSwitch'
  2. Drag the knob of any ToggleSwitch control.
  3. Drag to the on state
  4. Knob resetting position in a few frames and corrected position after that. The issue I described above.

Expected behavior Knob should moves fine, no position resetting. Here I have Control Gallery built on avalonia 0.10.14 and recorded gif animation: 1

Screenshots Here I recorded gif animations. Those gifs can explain this issue easily. In Avalonia Control Gallery: 1

In Material.Avalonia Demo: 2

Desktop (please complete the following information):

  • OS: Windows OS 21H2
  • Version 11.0.0-preview1

Additional context I think something with transition system wrong or might this line but I dont sure. I cant build avalonia library from my device even I reinstalled my visual studio 2022 and installed dotnet sdks.

appleneko2001 avatar Sep 14 '22 00:09 appleneko2001

Can you check if it was fixed after this PR? https://github.com/AvaloniaUI/Avalonia/pull/8918

maxkatz6 avatar Sep 14 '22 12:09 maxkatz6

Hi @maxkatz6 ! Ok I try it now, any results I will post comments here. Thanks for pay attention to this issue)

appleneko2001 avatar Sep 14 '22 12:09 appleneko2001

~~No more resetting position, just no transition now~~ The transition styles lost after rename control name, I corrected the style and the issue still persists. I'm using this style to transitioning knob of switch.

<Style Selector="^:not(.no-transitions) /template/ Panel#PART_MovingKnobs">
    <Setter Property="Transitions">
        <Transitions>
            <DoubleTransition Property="Canvas.Left" Duration="0.2" Easing="CircularEaseOut" />
        </Transitions>
    </Setter>
</Style>

appleneko2001 avatar Sep 14 '22 13:09 appleneko2001

I suppose it's possible something was missed in the renaming of template parts: https://github.com/AvaloniaUI/Avalonia/pull/8793. Just a thought, not saying that's it.

robloo avatar Sep 27 '22 01:09 robloo

Seems to be fixed by https://github.com/AvaloniaUI/Avalonia/pull/8793/files Please let me know if not.

maxkatz6 avatar Oct 31 '22 05:10 maxkatz6