Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop click event propagation #1291

Closed
lukejagodzinski opened this issue Dec 21, 2014 · 11 comments
Closed

Stop click event propagation #1291

lukejagodzinski opened this issue Dec 21, 2014 · 11 comments
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Milestone

Comments

@lukejagodzinski
Copy link

Hi, I know that there was several topics about event bubbling and stoping its propagation but I have not found solution for my problem. Here is an example scene http://jsfiddle.net/Jagi/2az8rgr4/6/ with Box child added to the Stage. Both Box and Stage have click event assigned. When I click Box the click event is triggered first on the Stage and later on the Box. This is totally confusing. Event bubbling should work different way: Box -> Stage -> Box. Now it's Stage -> Box. More over I can't stop propagation. I've read about InteractionManager and maybe it's a way of solving my problem. But I haven't found any example of using it in proper way with Pixi 2.2. Could anyone help?

@englercj englercj mentioned this issue Dec 26, 2014
@englercj englercj added 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. Interaction Manager labels Jan 8, 2015
@englercj englercj added this to the v3.0 milestone Jan 8, 2015
@GoodBoyDigital
Copy link
Member

Hi there! pixi v3 now has event.stopPropegation() that should do just what you need 👍 enjoy!

@perara
Copy link

perara commented Apr 16, 2015

Would this also work with events like mousemove?

x.mousemove =  (e) ->
    e.stopPropegation()

Does not seem to work in v3rc4 (undefined)

@lukejagodzinski
Copy link
Author

@GoodBoyDigital great to here!

@englercj
Copy link
Member

@perara It wasn't added in rc4, was added to the latest dev.

@perara
Copy link

perara commented Apr 17, 2015

@englercj Thanks. Works fine!

@Shadowstep33
Copy link

Does stopPropagation() work between events? For example, if I have stage and box (box being a child of stage), and stage allows you to drag using mouseup, mousedown, and mousemove while box just has a click on it. If i use stopPropagation in the box click method, will it prevent all three events on stage? Or will it just prevent everything that would happen after the click fires (i.e. mouseup on stage)?

@englercj
Copy link
Member

It should only prevent the click event, if it is stopping other events I would consider that a bug.

@Shadowstep33
Copy link

Cool thanks, that's what I thought but just wanted to make sure. Cheers!

@allenliao
Copy link

should be
x.mousemove = (e) ->
e.stopPropagation()
not
x.mousemove = (e) ->
e.stopPropegation()

@KosGrillis
Copy link

Is there a way to stop propagation of other events, specifically mouseover?

@lock
Copy link

lock bot commented Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

No branches or pull requests

7 participants