#815·OpenCut

Carousel cleanup leaves reInit listener attached

Author: pidouga-devCreated Jun 5, 2026Updated Sep 8, 2026

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.