iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.77k stars 1.16k forks source link

Button prevents scrollable touch scrolling #2004

Open iamsix opened 1 year ago

iamsix commented 1 year ago

Is there an existing issue for this?

Is this issue related to iced?

What happened?

When filling a scrollable entirely with a column of buttons the width of the scrollable, it's impossible to touch-scroll that scrollable since the button appears to consume the touch event before the scrollable gets it. Note mouse scrollwheel scrolling does work properly however.

I was trying to use this to approximate something like android's ListView where each item in the list is clickable.

Basic example testcase: https://gist.github.com/iamsix/dabd737e2dfa2f81b23c61353f6f3b8f

What is the expected behavior?

The scrollable should still function with touch scrolling.

Version

crates.io release

Operating System

Windows

Do you have any log output?

No response

MarcusGrass commented 1 year ago

Having the same issue, scrolling works "sometimes" then I figured out that it's working if you hit the padding between the buttons

genusistimelord commented 1 year ago

ahh, I think I get what you mean, drag scroll via grabbing a button and scrolling up or down is not working. and yeah I doubt it would since in this case a button is what you pressed. best way to solve this is probably make the scrollbar itself wider so its easier to touch with the finger on screen. Not sure there is much you can do on this currently...