New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll on focus without animation #2342
Comments
Thanks for the suggestion. A similar issue came up once to disable to scroll animation when the tabview changes tab. The use case was the same: animations are ugly on a slow screen. The idea of mimicking CSS's prefers-reduced-motion also came up but finally, we found a local solution to it. Thinking about it again @embeddedt @boraozgen What do you think? |
I think |
Attaching it to the screen doesn't seem to call the event handler. It is not in the bubbled list anyway: Line 405 in ebb9ce9
Attaching it to the scrollable object gets the handler called, but does not seem to disable the animation for me. I'm running v8.0.1, if that makes any difference. Edit: I just checked
This should not disable animations completely, as animations with small objects usually run OK. I think I would prefer switches/configurations for each use case, providing more flexibility. |
I agree; that's why I suggested the bubbling approach. I'll need to test it to find out why it's not being bubbled; the list in
Lines 274 to 276 in ebb9ce9
|
Not for y direction :) is there a particular reason or is it a bug?
True. I checked again, my object seems to have |
That is indeed a bug. I see no reason why the two axes should behave differently. Thank you for pointing it out, and sorry that I missed it when you mentioned it earlier. 🙂 Fixed here: b158932
I thought it was enabled by default, but upon a closer look, it appears that you do have to set it manually. That makes my solution much more cumbersome, as you would essentially have to enable this flag on all your objects. |
The BTW I noticed another issue: It looks weird when the scrollbar lights up when the animation is disabled. It flashes once as the scrolling takes just a moment. Can we disable this too? |
Thanks. Are the fixes going to be cherry picked into v8 during release? Did you consider another branch model? |
Yes. As of v8, minor versions receive fixes for 1 year as well, so 8.0.2 should arrive sooner rather than later. |
The scroll events are not bubbled as it'd mean a huge amount of
You can disable the scroll "effect" with lv_obj_remove_style(cont, NULL, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); |
Thanks. Then my issue is resolved, you can close the issue or leave it open depending on whether you think it makes sense to add a configuration for this. |
Great! Let's see if we get other related issues. If so we can find a more generic solution. So I close this issue for now. |
I came up with an idea while I was trying to disable the animations for |
By the scrollbar animation do you mean
|
I mean the movement of the scrollbar. |
I'd find it a little bit misleading as not really to scrollbar is moving. It's just an indicator of the moving content. |
Introduce the problem
In case
LV_OBJ_FLAG_SCROLL_ON_FOCUS
is set, the object scrolls into view when focused:lvgl/src/core/lv_obj.c
Lines 671 to 673 in 77cedfa
Here, the scroll animation is on by default and cannot be turned off.
Examples and cases
Turning off these animations could be important for resource-constrained, keypad based systems, where the animations are slow, yet scrolling is desired.
Suggested solution
We can make this configurable, the place and switch name are up to the maintainers.
The text was updated successfully, but these errors were encountered: