Closed FloVanGH closed 2 years ago
Playing a little bit with fast pressing, the animation sometimes works. If I press slow no animation.
Thanks for your bug report. I can reproduce the bug in the wasm code editor But i cannot really reproduce it on the X11 desktop (both backend).
I'll have to investigate why the animation don't work. (Maybe something related to the time computation on wasm? (wild guess))
What platform/backend are you using?
@ogoffart thank you for the answer.
I tested it on macOS. My guess is, that the key event blocks the animation until the key is released. But in the meantime the x position is set through the binding.
I found out the cause: we were not registering time update before key events, causing the runtime to think that the time was still earlier than it was when the event occurs, making the starting time of the animation too much in the past.
@ogoffart: nice thank you :-)
I checked your PR, it works well now :-).
I use a
FocusScope
to change aselected-index
by left or right arrow key pressed. I navigate translate x of my layout to show the element on the selected-index. The change ofx
is animated. If I change theselected-index
by aclicked
handler the animation works fine but if i press left or right arrow key, x is changed but the animation does not work.