Avalonia
Avalonia copied to clipboard
ToggleSwitch knob resetting position a while after knob dragging is over (11.0.0-preview1)
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:
- Go to 'ToggleSwitch'
- Drag the knob of any
ToggleSwitch
control. - Drag to the on state
- 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:
Screenshots
Here I recorded gif animations. Those gifs can explain this issue easily.
In Avalonia Control Gallery:
In Material.Avalonia Demo:
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.
Can you check if it was fixed after this PR? https://github.com/AvaloniaUI/Avalonia/pull/8918
Hi @maxkatz6 ! Ok I try it now, any results I will post comments here. Thanks for pay attention to this issue)
~~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>
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.
Seems to be fixed by https://github.com/AvaloniaUI/Avalonia/pull/8793/files Please let me know if not.