Closed jollygreenegiant closed 2 years ago
Hi @jollygreenegiant , Is this the behaviour you expect?
Yes, that is exactly what I would expect, thanks for the video! That is not what I'm seeing though, is there a way to get that behavior?
@jollygreenegiant Great, That is how it works by default. in your screen, any root composable might affect the drag event. to verify the behaviour, you could test ratingbar composable on a separate screen.
I've done some looking into this and the issue is because I have the rating bar in a LazyColumn, and the vertical component of the drag on the rating bar is being picked up by the LazyColumn instead. I didn't realize this at first because the LazyColumn didn't have enough things in it to be scrollable, but once the list goes off the end of the screen, the vertical component of the drag on the rating bar is used to scroll the LazyColumn.
Any ideas how to fix that?
Similarly, if this RatingBar were placed in a LazyRow, I imagine that the horizontal drag on the rating bar would be consumed by the LazyRow instead
Thanks, @jollygreenegiant I am able to reproduce the issue. will update a workaround or fix asap
Thank you!
Hi @jollygreenegiant , fixed the issue in the latest version 1.2.0 thanks for finding this one
.
When dragging along the RatingBar, if your finger leaves the bounds of the view, the stars stop updating. For example, if I have the RatingBar in the top left corner of the screen, as a user, I would expect that if I touched inside the stars and dragged to the bottom right of the screen, the rating bar should fill up and not lose my touch event when my finger leaves the stars.
I think the rating bar should track the X position of the users finger regardless of where it is on the screen, as long as the touch started inside the RatingBar. This is the same behavior that sliders have in Android, which is why it feels like it should be the default behavior here as well.