Hi 🙂
With compose navigation bottom bar, how can I get the usual behaviour of scrolling to top when tapping the icon of the screen i'm already on ?
p
Pavel Marchenko
11/13/2020, 3:15 PM
Hi, I had similar problem to solve but not for nav bottom bar so may be, my solution will not be ideal for your case.
The idea is to recreate [scrollState] and recompose with new state:
when you detect tap on the icon - update the [key] and trigger recomposition.
I'm not sure this is the best approach, so if someone has different approach in mind please let me know.
👍 1
c
Cyril Find
11/13/2020, 3:57 PM
oh ok yeah that's not super intuitive but it's smart, thanks ! ^^