Skip to content

[@mantine/carousel] Carousel: Report same-tick slide changes - #9574

Draft
rishabhx29 wants to merge 1 commit into
mantinedev:masterfrom
rishabhx29:fix/carousel-slide-change-ref
Draft

rishabhx29 wants to merge 1 commit into
mantinedev:masterfrom
rishabhx29:fix/carousel-slide-change-ref

Conversation

@rishabhx29

Copy link
Copy Markdown
Contributor

handleSelect compares the new Embla index against selected from the render closure. When Embla emits two select events in the same tick, React has not re-rendered yet, so the second event still sees the old index and onSlideChange is skipped.

This PR tracks the last reported index in a ref and updates it synchronously. A regression test uses a deterministic Embla mock to emit two selections in one tick and verifies both callbacks are reported.

  • npm run jest -- packages/@mantine/carousel/src --runInBand (84 tests)
  • npx oxlint -c oxlint.config.mjs on changed files
  • npx tsc -p packages/@mantine/carousel/tsconfig.build.json --noEmit

@rishabhx29
rishabhx29 marked this pull request as draft December 5, 2026 09:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant