Scroll to specific widget

Hey there, I’m new to iced. I’m trying to make a chat app for learning purposes, and I want to be able to let the user click on a reply and automatically scroll to that reply. I see that there’s a scroll_to method on scrollable, but I can’t seem to figure out a god way to get the absolute offset of a container inside the scrollable.

I wrote an example for doing that in my sweeten crate, but it’s in the 0.14.0-dev branch which isn’t 100% on track with the latest iced from the master branch on github, but is hopefully close

in theory you should be able to copy and paste sweeten::widget::row and sweeten::operation::position into a project that uses the latest iced from master on github and solve any compiler errors until it works

You’re a lifesaver, this is amazing, tysm!

1 Like