pmndrs / pmndrs/ecctrl

useFollowCam should optionalEl.addEventListener instead of always using document

Open
#34 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
797
Forks
98
Avg merge
8m
Merged PRs (30d)
1

Description

Thanks for the great library!

When I run two Three.js scenes on the same page,
your <Ecctrl> reacts to events coming from the other scene.

This happens because you document.addEventListener in useFollowCam.tsx.

Could we optionally provide an alternative root element?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with useFollowCam.tsx, where document.addEventListener is used for Ecctrl events, and trace how the hook is configured by each scene. Done means an optional root element can be supplied so event handling is scoped to that scene rather than the whole document.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, three.js, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.