Repository navigation
fix(usePresence): handle canceled exit animations - #24056
rileydanejohnston wants to merge 3 commits into
Conversation
✅ Deploy Preview for v12-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v12-carbon-web-components ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
All contributors have signed the DCO. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I have read the DCO document and I hereby sign the DCO. |
|
[AI agent review — Carbon grounded] · Looks Good · Reviewed by: IBM Bob · Commit: 53a5ba4 This PR adds a rejection handler to the exit-animation promise chains in usePresence and useSidePanelPresence, so a canceled animation no longer causes an unhandled AbortError. It also adds tests for the canceled-animation case. |
✅ Deploy Preview for v11-carbon-web-components ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Closes #23659
Animation.finishedrejects with anAbortErrorwhen an exit animation is canceled, for example when a component unmounts during its exit animation.usePresenceanduseSidePanelPresencechained.finally()with no rejection handler, so the rejection surfaced as an unhandled promise rejection. Both hooks now handle it, and the exit still finishes the same way. Picks up from #23670, which was closed in a draft cleanup.Changelog
New
useSidePanelPresence, including the canceled-animation caseChanged
usePresenceanduseSidePanelPresencehandle theAbortErrorfrom a canceled exit animation instead of leaving it unhandledusePresencetests cover a canceled exit animationTesting / Reviewing
yarn test packages/react/src/internal/__tests__/usePresence-test.js packages/react/src/internal/__tests__/useSidePanelPresence-test.jsmainwithAbortError: The animation was aborted.(unhandled rejection) and pass with this changePR Checklist
As the author of this PR, before marking ready for review, confirm you:
Updated documentation and storybook examples(internal hooks, no API change)Followed the required v12 migration documentation for any code change that affects v12, or struck through this item because the PR does not affect v12Addressed any impact on accessibility (a11y)(no a11y impact)Tested for cross-browser consistency(promise handling only, no rendering change)More details can be found in the pull request guide.