Skip to content

fix(runtime-core): avoid unexpected cancelled parameter in transition done callback#14391

Open
KazariEX wants to merge 1 commit intovuejs:mainfrom
KazariEX:fix/transition-done-cancelled
Open

fix(runtime-core): avoid unexpected cancelled parameter in transition done callback#14391
KazariEX wants to merge 1 commit intovuejs:mainfrom
KazariEX:fix/transition-done-cancelled

Conversation

@KazariEX
Copy link
Member

@KazariEX KazariEX commented Feb 2, 2026

Code like this does not actually report a type error, even though done has the correct type:

const onLeave: BaseTransitionProps["onLeave"] = (el, done) => {
  animate({ ... }).then(done);
};

This will cause the leave-cancelled event to always be triggered instead of the after-leave event.

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

The enter and leave transition hooks in BaseTransition.ts are refactored to assign callback functions directly to element properties (el[enterCbKey]/el[leaveCbKey]), then derive the done callback by binding false to the stored function reference instead of using a separately defined callback.

Changes

Cohort / File(s) Summary
Callback Assignment Refactor
packages/runtime-core/src/components/BaseTransition.ts
Modified how done callbacks are created in enter/leave transition hooks by deriving them through binding the stored callback function reference rather than using inline-defined callbacks, maintaining semantic equivalence with adjusted callback derivation mechanism.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • vuejs/core#13152: Exposes leaveCbKey and invokes the stored leaving callback from the renderer to cancel/complete leaves, directly complementing the callback assignment changes in this PR.

Suggested labels

ready to merge, scope: transition, :hammer: p3-minor-bug

Poem

🐰 A callback's path is redrawn with care,
Bound tighter now, a binding affair,
No inline dance, just reference refined,
The leaving completes with a binding bind! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main issue being fixed: preventing an unexpected cancelled parameter in the transition done callback, which aligns with the PR's core objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 103 kB (+48 B) 39.1 kB (+14 B) 35.2 kB (+20 B)
vue.global.prod.js 162 kB (+48 B) 59.1 kB (+13 B) 52.6 kB (+16 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47 kB 18.3 kB 16.8 kB
createApp 55.1 kB 21.4 kB 19.6 kB
createSSRApp 59.4 kB 23.2 kB 21.1 kB
defineCustomElement 60.8 kB 23.1 kB 21.1 kB
overall 69.5 kB (+48 B) 26.7 kB (+13 B) 24.4 kB (+48 B)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 2, 2026

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@14391
npm i https://pkg.pr.new/@vue/compiler-core@14391
yarn add https://pkg.pr.new/@vue/compiler-core@14391.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@14391
npm i https://pkg.pr.new/@vue/compiler-dom@14391
yarn add https://pkg.pr.new/@vue/compiler-dom@14391.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@14391
npm i https://pkg.pr.new/@vue/compiler-sfc@14391
yarn add https://pkg.pr.new/@vue/compiler-sfc@14391.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@14391
npm i https://pkg.pr.new/@vue/compiler-ssr@14391
yarn add https://pkg.pr.new/@vue/compiler-ssr@14391.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@14391
npm i https://pkg.pr.new/@vue/reactivity@14391
yarn add https://pkg.pr.new/@vue/reactivity@14391.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@14391
npm i https://pkg.pr.new/@vue/runtime-core@14391
yarn add https://pkg.pr.new/@vue/runtime-core@14391.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@14391
npm i https://pkg.pr.new/@vue/runtime-dom@14391
yarn add https://pkg.pr.new/@vue/runtime-dom@14391.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@14391
npm i https://pkg.pr.new/@vue/server-renderer@14391
yarn add https://pkg.pr.new/@vue/server-renderer@14391.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@14391
npm i https://pkg.pr.new/@vue/shared@14391
yarn add https://pkg.pr.new/@vue/shared@14391.tgz

vue

pnpm add https://pkg.pr.new/vue@14391
npm i https://pkg.pr.new/vue@14391
yarn add https://pkg.pr.new/vue@14391.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@14391
npm i https://pkg.pr.new/@vue/compat@14391
yarn add https://pkg.pr.new/@vue/compat@14391.tgz

commit: 4768e8f

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Feb 2, 2026

📝 Ran ecosystem CI: Open

suite result latest scheduled
vant success success
nuxt success success
language-tools success success
quasar success success
vitepress success success
radix-vue success success
primevue success success
router failure failure
pinia success success
vue-i18n success success
test-utils success success
vite-plugin-vue success success
vueuse success success
vue-macros success success
vuetify success success
vue-simple-compiler success success

@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready to merge The PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants