Skip to content

fix(runtime-vapor): sync radio v-model on mount when the model is undefined - #16094

Merged
edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-radio-undefined-model
Nov 3, 2026
Merged

edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-radio-undefined-model

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

In Vapor, a radio bound with v-model is not checked on mount when the model starts as undefined and the radio's value is undefined too. This is the common "All / Any" option of a filter: <input type="radio" v-model="filter" :value="undefined"> with const filter = ref(). VDOM (and SSR) render it checked; Vapor leaves every radio unchecked until the model changes.

applyRadioModel only syncs checked when the model differs from its previous value, and that previous value starts as undefined, so the first sync is skipped. The first pass now always syncs. For an initially undefined model, like VDOM, it does not uncheck a radio the template marked checked on a client mount, while a hydrated radio follows the client model.

Real example: drizzle-duckdb-wasm playground.

Playground

@coderabbitai

coderabbitai Bot commented Nov 2, 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2cf4a5ae-ada1-433f-9607-213be07bf2eb

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 5fec991

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.4 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 121 kB 45.3 kB 40.6 kB
vue.global.prod.js 181 kB 65.6 kB 58.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.9 kB 21 kB 19.1 kB
createApp 62.9 kB 24.3 kB 22.1 kB
createApp + vaporInteropPlugin 118 kB 43 kB 38.7 kB
createVaporApp 34.2 kB 13.2 kB 12.2 kB
createSSRApp 67.8 kB 26.3 kB 23.8 kB
createVaporSSRApp 42 kB 16 kB 14.8 kB
defineCustomElement 69.5 kB 26.3 kB 23.9 kB
defineVaporCustomElement 49.1 kB 18 kB 16.5 kB
overall 78.4 kB 29.8 kB 27 kB

@edison1105

Copy link
Copy Markdown
Member

The initial-sync fix makes sense, but please limit the checked preservation to the initially undefined case rather than changing the behavior for all initial model values.

isHydrating can already be false when the deferred model directive runs if a later root in the same block encountered a mismatch—even though this radio was successfully adopted from SSR. With a server-checked value="a" radio and a client model of 'b', the new guard would preserve the stale checked state, whereas the previous implementation cleared it.

Keeping the existing behavior for non-undefined models should avoid that regression without introducing additional hydration tracking:

if (checked || !initial || value !== undefined || hydrating) {
  el.checked = checked
}

Please also add a compiled hydration regression test with an adopted radio followed by a mismatched sibling root, and adjust the comment to reflect the narrower preservation rule. Broader alignment of explicit checked with VDOM mount ordering should stay outside this fix.

@edison1105 edison1105 added wait changes scope: vapor related to vapor mode labels Nov 3, 2026
@ValentinYoushkevich

Copy link
Copy Markdown
Contributor Author

Thanks, narrowed the preservation to an initially undefined model

@edison1105
edison1105 merged commit 63c6379 into vuejs:minor Nov 3, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants