UI Srollview and Events

I am having a large image in a scrollview. Scrolling around works. Within the scrollview I have some buttons overlaying the image. Works all fine.

However. If I have my finger accidentally over a Button, scrolling the whole image and then release the touch an onRealese Event is fired which is unwanted. The finger is not over the interactive element anymore, thus there should not be an OnRelease event.

Alternativly I would need Events for the scrollview itself. Is there something like in native IOS such as “onWillStartDragging”, “onDidStartDragging”, “onDrag”, “onWillEndDragging”, “onDidEndDrag”???

Well at least I want to avoid that things get clicked/Touched while I am dragging.

Sounds like this bug https://github.com/playcanvas/engine/issues/2165

Does this happen with mouse input?

There is this event that I believe gets fired when it scrolls https://developer.playcanvas.com/en/api/pc.ScrollViewComponent.html#event:set:scroll

hard to explain. I guess yes.

Another unwanted thing is: I have other Buttons on top of the scrollview. If I click the scrollview to scroll, but release on an overlaying button, than its release event is fired as well. Wich is also unwanted.

all touch and mouse events should be coupled. it cannot be, that you beginTouch on one Thing but a release Touch is fired on another thing.

And yes, I know, this was not a good answer.

As for your hint… hmmm. need to try. Whats about the - how do you call that - animation, when you release but the content is still under Animation and bounces and what not?

And for your “bug report”. Yeah, seams like it.

If you can post up an example project with this issue, that would really help, just to make sure we are in the same page and see the set up.

hm, project is private but I could at you as an admin.
can I pm you somehow?

Other than that for mobile testing, we have this on a hidden server. I could point you to that just to see the issues. But this also only under PM

eher are you anyways, I am in Europe and its already 23.00 pm. won’t stay up for to long.

It would be best if you are able to create a new project with the same issue. That way, we will be able to test a potential fix against it.

Edit: it doesn’t have to be soon, chances are that we won’t be able to look at it till later next week at best.

I guess I could use this one mentioned event in combination with a timer to solve my problem.
However my JS Skills are not so good and so far I can not listen to the event

in one script I did this:

var EventReceiver = pc.createScript('eventReceiver');

EventReceiver.attributes.add('scrollview', {type: 'entity', title: 'scrollview'});


EventReceiver.prototype.initialize = function() {

    this.scrollview.element.on('scroll', this.isScrolling, this);

And finally:

EventReceiver.prototype.isScrolling = function(delta) {
    console.log("is scrolling " + delta);

Here’s a quick example of using that event: https://playcanvas.com/editor/code/735178?tabs=37745013&line=37


found it. The correct way is just in my case:

this.scrollview.scrollview.on(‘set:scroll’, this.isScrolling, this);