OpenCut-app / OpenCut-app/OpenCut
Carousel cleanup leaves reInit listener attached
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 89.8k
- Forks
- 8.9k
- PR merge metrics
- No merged PRs in 30d
Description
Summary
The Carousel component subscribes the same onSelect handler to both Embla reInit and select events, but the effect cleanup only removes the select listener.
That means the reInit listener can remain attached after the effect is cleaned up, which can lead to duplicate handlers after remounts or API changes.
I prepared a minimal patch in a public fork:
https://github.com/pidouga-dev/OpenCut/tree/codex/carousel-reinit-cleanup
Commit:
https://github.com/pidouga-dev/OpenCut/commit/9506272ac9f4025d4f3aff0ff5a6542cc5752ea0
Patch
Add the missing api.off("reInit", onSelect) call in the cleanup function.
Verification
- bun --filter @opencut/web build
Note: I could not open a PR because GitHub shows that this repository limits pull request creation to collaborators.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Carousel component's effect cleanup, where the onSelect handler is registered for Embla's reInit and select events. Run bun --filter @opencut/web build; done means cleanup removes both listeners and the web build passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100