Skip to content

Support Pointer Events #3

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

Merged
merged 7 commits into from
Oct 31, 2024
Merged

Support Pointer Events #3

merged 7 commits into from
Oct 31, 2024

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
Contributor

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

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

@marklundin
Copy link
Member Author

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


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

generally camel case in react https://react.dev/learn/responding-to-events

@marklundin marklundin merged commit c75af44 into main Oct 31, 2024
@marklundin marklundin deleted the feat-pointer-events branch October 31, 2024 16:30
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