You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Egui should allow specifying whether scrolling in a ScrollArea should be animated (and also allow changing the animation duration, although that is not important for my problem)
Is your feature request related to a problem? Please describe.
After #4119 scrolling to a certain offset is always animated, this breaks egui_virtual_list, which relied on scroll_to_rect to instantly update the scroll position. This is necessary when the user scrolls up in a infinite scroll list that loads at the top and new content is added at the top (the scroll position is offset by the height of the new content). If the scroll is animated here, the list unexpectedly jumps for the user.
Describe the solution you'd like
Maybe add an additional parameter to the scroll functions, a bool or maybe a enum like
I also saw a TODO comment saying this should be made configurable via Style, but that would cause an issue for my crate, if I set the scroll animation duration to zero the user might override this at a later point causing the infinite scroll to break. The user could work around this by only updating the style if scroll_to_* is actually called but this wouldn't be ideal.
Maybe there could be e.g. a scroll_to_rect() with the current signature which uses the value from Style and an additional funciton like scroll_to_rect_animated() that takes the enum from above as an additional argument.
Describe alternatives you've considered
My problem could also be solved by #2783, which would allow me to use scroll_with_delta, which curiously doesn't seem to have an animation (I'm not sure if this is intentional). But due to #2783, scroll_with_delta doesn't work reliably for me.
The text was updated successfully, but these errors were encountered:
lucasmerlin
changed the title
Add some way to specify whether scroll_to etc.. should be animated
Add some way to specify whether scroll_to_rect etc.. should be animated
Mar 31, 2024
Egui should allow specifying whether scrolling in a ScrollArea should be animated (and also allow changing the animation duration, although that is not important for my problem)
Is your feature request related to a problem? Please describe.
After #4119 scrolling to a certain offset is always animated, this breaks egui_virtual_list, which relied on scroll_to_rect to instantly update the scroll position. This is necessary when the user scrolls up in a infinite scroll list that loads at the top and new content is added at the top (the scroll position is offset by the height of the new content). If the scroll is animated here, the list unexpectedly jumps for the user.
Describe the solution you'd like
Maybe add an additional parameter to the scroll functions, a bool or maybe a enum like
I also saw a TODO comment saying this should be made configurable via Style, but that would cause an issue for my crate, if I set the scroll animation duration to zero the user might override this at a later point causing the infinite scroll to break. The user could work around this by only updating the style if scroll_to_* is actually called but this wouldn't be ideal.
Maybe there could be e.g. a scroll_to_rect() with the current signature which uses the value from Style and an additional funciton like scroll_to_rect_animated() that takes the enum from above as an additional argument.
Describe alternatives you've considered
My problem could also be solved by #2783, which would allow me to use scroll_with_delta, which curiously doesn't seem to have an animation (I'm not sure if this is intentional). But due to #2783, scroll_with_delta doesn't work reliably for me.
The text was updated successfully, but these errors were encountered: