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

Support Pointer Events #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Support Pointer Events #3

wants to merge 7 commits into from

Conversation

marklundin
Copy link
Member

@marklundin marklundin commented Oct 24, 2024

This PR adds preliminary support for pointer events on <Entity/> components. It replicates standard dom-like event behaviour such as event bubbling and stopPropagation() via synthetic events. It also support click

<Entity onPointerDown={() => console.log("Parent triggered" }>
  <Entity onPointerDown={(e} => {console.log("pointer down"}; e.stopPropagation()} />
  <Entity onPointerDown={(e} => {console.log("pointer down"}; } />
</Entity>

Supported events:
onPointerDown
onPointerUp
onPointerOver
onPointerOut
onClick

@marklundin marklundin added the enhancement New feature or request label Oct 24, 2024
@marklundin marklundin self-assigned this Oct 24, 2024
@marklundin
Copy link
Member Author

Added additional onPointerOver, onPointerOut and onClick events

@willeastcott
Copy link

Aren't generic attributes lower case instead of camel case? e.g.:

<div onclick="console.log('ouch')"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants