compose-menu icon indicating copy to clipboard operation
compose-menu copied to clipboard

Implement fling on scrollbar

Open HLCaptain opened this issue 1 year ago • 8 comments

Add velocity to the scroll area when the user lifts up their fingers while dragging it, just like on iOS.

HLCaptain avatar Sep 30 '24 18:09 HLCaptain

I like this suggestion. The ios native ones feel great because of this.

alexstyl avatar Oct 01 '24 07:10 alexstyl

This is very low priority for me as I am focusing on Compose Desktop/Web right now.

If anyone wants to have a go at it, feel free to do so. If you need more clarifications about it, feel free to reply to this issue.

All related code is in ScrollArea.kt

alexstyl avatar Oct 05 '24 16:10 alexstyl

I think this is behavior is now implemented in CMP 1.8.0, right?

krizzu avatar May 23 '25 20:05 krizzu

@krizzu how so?

alexstyl avatar May 24 '25 04:05 alexstyl

CMP 1.8.0 has a native iOS scroll physics, but I must have misunderstood - we're not talking about just iOS platforms, right?

krizzu avatar May 24 '25 07:05 krizzu

As far as I understand and tested it, it just tries to mimic the native scroll implementation and it is not related to the scrollbar at all. It is just a custom overscroll effect for iOS.

HLCaptain avatar May 24 '25 07:05 HLCaptain

As far as I understand and tested it, it just tries to mimic the native scroll implementation and it is not related to the scrollbar at all. It is just a custom overscroll effect for iOS.

If you folks are talking about the announcement about iOS being stable, then @HLCaptain is right. The CMP team introduced a Overscroll effect that mimics the bouncy effect of iOS. Unstyled makes use of that API so that you can further customize that effect further (such as which areas should it be applied to).

Regarding the fling on the scrollbar that is a different topic entirely. I want to revisit scrollbars now that iOS hit stable and replace the original implementation with a new one, more fitting for Unstyled now that the lib is becoming more popular in the community.

alexstyl avatar May 24 '25 08:05 alexstyl

Make sense, I mistakenly took other implementation as this library's scrollbar, apologies for the confusion 🙏

krizzu avatar May 24 '25 11:05 krizzu