Skip to content

fix(compiler-vapor): register same-element listeners after v-model - #15646

Merged
edison1105 merged 4 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-vmodel-listener-order
Sep 28, 2026
Merged

edison1105 merged 4 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-vmodel-listener-order

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Since #15201 moved v-model after the other operations of an element, a listener written next to a native v-model is added before v-model's own one. So it runs first and reads the old value: <select v-model="country" @change="loadCities(country)"> loads the previous country, and <input v-model="q" @input="search(q)"> searches one keystroke behind. VDOM always sees the new value, since the vModel directive adds its listener in created, before props are patched. Playground: pick "de" and type a letter, then remove vapor.

v-model operations still come after props and effects, so the dynamic :type case from #15200 keeps working. Only the listeners of the same element (static, @[event], v-on="obj") are now generated right after them. Listeners coming through v-bind="$attrs" are still set together with the props in setDynamicProps, so that form isn't covered here.

A real case: in epkl4-siswa, a <script setup vapor> page, @change="getJournals" builds its query from the v-model value, so changing the filter loads the journals of the previous one.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bb9bbcb9-c26e-4bc1-9101-6fdff51e2c2f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15646
npm i https://pkg.pr.new/@vue/compiler-core@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15646
npm i https://pkg.pr.new/@vue/compiler-dom@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15646
npm i https://pkg.pr.new/@vue/compiler-sfc@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15646
npm i https://pkg.pr.new/@vue/compiler-ssr@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@15646
npm i https://pkg.pr.new/@vue/compiler-vapor@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15646
npm i https://pkg.pr.new/@vue/reactivity@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15646
npm i https://pkg.pr.new/@vue/runtime-core@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15646
npm i https://pkg.pr.new/@vue/runtime-dom@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@15646
npm i https://pkg.pr.new/@vue/runtime-vapor@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15646
npm i https://pkg.pr.new/@vue/server-renderer@15646
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15646
npm i https://pkg.pr.new/@vue/shared@15646
yarn add https://pkg.pr.new/@vue/[email protected]

vue

pnpm add https://pkg.pr.new/vue@15646
npm i https://pkg.pr.new/vue@15646
yarn add https://pkg.pr.new/[email protected]

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15646
npm i https://pkg.pr.new/@vue/compat@15646
yarn add https://pkg.pr.new/@vue/[email protected]

commit: 4285503

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB 30.6 kB 26.9 kB
runtime-dom.global.prod.js 116 kB 43.9 kB 39.2 kB
vue.global.prod.js 176 kB 64 kB 57 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.1 kB 20.7 kB 18.9 kB
createApp 61.9 kB 23.9 kB 21.7 kB
createApp + vaporInteropPlugin 126 kB 45.2 kB 40.7 kB
createVaporApp 31.6 kB 12.2 kB 11.2 kB
createSSRApp 66.9 kB 25.9 kB 23.6 kB
createVaporSSRApp 38.2 kB 14.5 kB 13.3 kB
defineCustomElement 68.4 kB 25.9 kB 23.5 kB
defineVaporCustomElement 47 kB 17.1 kB 15.7 kB
overall 77.4 kB 29.4 kB 26.7 kB

@edison1105
edison1105 force-pushed the fix/vapor-vmodel-listener-order branch from 935c9a8 to 8fc385a Compare September 28, 2026 09:57
ValentinYoushkevich and others added 3 commits September 28, 2026 17:57
Keep merged native listeners separate from DOM props so dynamic input types initialize before v-model. Preserve handler merge order and effect cleanup without eagerly caching handler bodies.
@edison1105
edison1105 force-pushed the fix/vapor-vmodel-listener-order branch from 8fc385a to 3724da7 Compare September 28, 2026 09:59
@edison1105
edison1105 merged commit 19a7a43 into vuejs:minor Sep 28, 2026
15 checks passed
zhiyuanzmj added a commit to vuejs/vue-jsx-vapor that referenced this pull request Oct 3, 2026
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.

2 participants