Repository navigation
fix(runtime-vapor): sync radio v-model on mount when the model is undefined - #16094
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
The initial-sync fix makes sense, but please limit the
Keeping the existing behavior for non- 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 |
…ly undefined model
|
Thanks, narrowed the preservation to an initially undefined model |
In Vapor, a radio bound with
v-modelis not checked on mount when the model starts asundefinedand the radio's value isundefinedtoo. This is the common "All / Any" option of a filter:<input type="radio" v-model="filter" :value="undefined">withconst filter = ref(). VDOM (and SSR) render it checked; Vapor leaves every radio unchecked until the model changes.applyRadioModelonly syncscheckedwhen the model differs from its previous value, and that previous value starts asundefined, so the first sync is skipped. The first pass now always syncs. For an initiallyundefinedmodel, like VDOM, it does not uncheck a radio the template markedcheckedon a client mount, while a hydrated radio follows the client model.Real example: drizzle-duckdb-wasm playground.
Playground