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 Pointer-Event from propagating #912

Closed
pikooh opened this issue Nov 27, 2017 · 5 comments
Closed

Stop Pointer-Event from propagating #912

pikooh opened this issue Nov 27, 2017 · 5 comments
Labels
feature Label applied to new feature requests

Comments

@pikooh
Copy link
Contributor

pikooh commented Nov 27, 2017

Context

If there are 2 actors overlapping and both listen to pointer events and the overlapping area is clicked, both receive the click event. This is not always desirable.

Demo: https://codepen.io/piko_/pen/ooPNaB

Proposal

It would be good to be able to stop the propagation of input events.

@kamranayub
Copy link
Member

kamranayub commented Nov 27, 2017 via email

@eonarheim
Copy link
Member

Agreed, it shouldn't be too difficult to include this behavior in our event handling scheme

@jedeen jedeen added the feature Label applied to new feature requests label Nov 29, 2017
@jedeen jedeen added this to the vNext milestone Nov 29, 2017
@pathurs
Copy link
Contributor

pathurs commented Mar 16, 2018

I'd like to try this one next, if that's okay.

What will I do?
Event.stopPropagation() should work the same way as https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation

@kamranayub
Copy link
Member

kamranayub commented Mar 16, 2018 via email

@pathurs
Copy link
Contributor

pathurs commented Mar 17, 2018

I will probably do #389 as well as add support for Event.preventDefault() to my changes for this. Most likely plus some extra improvements, because who doesn't like free stuff?

LoserAntbear pushed a commit to LoserAntbear/Excalibur that referenced this issue Apr 20, 2018
LoserAntbear pushed a commit to LoserAntbear/Excalibur that referenced this issue Apr 20, 2018
LoserAntbear pushed a commit to LoserAntbear/Excalibur that referenced this issue Apr 20, 2018
eonarheim pushed a commit that referenced this issue May 9, 2018
Closes #912 

## Changes:

- Adds PointerEvent.stopPropagation() functionality that behaves as described at https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation.
- `jasmine.d.ts` type definitions are now for Jasmine 2.8.0. It equals to the version used in current development.
- Added `jasmine-core` package from `v2.8.0` accordingly to version it should use.
- Event propagation made less greedy.
- Class `BubblingEvent` added which extends `GameEvent`.
- Property scope `Pointer.actorsUnderPointer` changed to private.
- New interface `IActorUnderPointer` added, which provides `length` property to old untyped `Pointer.actorsUnderPointer` object
- `CapturePointer.update()` method now doesn't propagate event to actor, just verifies pointer events for actor.
@jedeen jedeen modified the milestones: vNext, 0.17.0 Release May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Label applied to new feature requests
Projects
None yet
Development

No branches or pull requests

5 participants