Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(QRadio/QCheckbox): checked must be set as .prop to change the native form value and as .attr to change the html attr #15182 #15183

Merged
merged 1 commit into from Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/src/components/checkbox/use-checkbox.js
Expand Up @@ -112,6 +112,8 @@ export default function (type, getInner) {
const prop = { type: 'checkbox' }

props.name !== void 0 && Object.assign(prop, {
// see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
'.checked': isTrue.value,
'^checked': isTrue.value === true ? 'checked' : void 0,
name: props.name,
value: modelIsArray.value === true
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/radio/QRadio.js
Expand Up @@ -100,6 +100,8 @@ export default createComponent({
const prop = { type: 'radio' }

props.name !== void 0 && Object.assign(prop, {
// see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
'.checked': isTrue.value === true,
'^checked': isTrue.value === true ? 'checked' : void 0,
name: props.name,
value: props.val
Expand Down