Skip to content

Panning a ScrollView by dragging #2235

Answered by ogoffart
mgunyho asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, this is tricky because the TouchArea itself is moving.
But you can also take that to your adventage and you don't need the state.

Have you tried this:

                   moved => {
                        scroll.viewport-x += (self.mouse-x - self.pressed-x);
                        scroll.viewport-y += (self.mouse-y - self.pressed-y);
                    }

Looks like it works

I see that ScrollView has a Flickable inside it, with interactive: false. The simplest option would be to expose this as a public property of the ScrollView so that it could be enabled.

Yes, that is a good point. We could forward that property. But interactive would not be the right name for that property bec…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mgunyho
Comment options

@bjorn
Comment options

@mgunyho
Comment options

@mgunyho
Comment options

Answer selected by mgunyho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants