Skip to content

Commit cb42196

Browse files
committed
fix(QuestionMultiple): update NcCheckboxRadioSwitch to use v-model for better data binding
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 980f753 commit cb42196

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/components/Questions/QuestionMultiple.vue‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,26 @@
7979
:key="answer.id"
8080
:aria-errormessage="hasError ? errorId : undefined"
8181
:aria-invalid="hasError ? 'true' : undefined"
82-
:checked="questionValues"
82+
:model-value="questionValues"
8383
:value="answer.id.toString()"
8484
:name="`${id}-answer`"
8585
:type="isUnique ? 'radio' : 'checkbox'"
8686
:required="checkRequired(answer.id)"
87-
@update:checked="onChange"
87+
@update:modelValue="onChange"
8888
@keydown.enter.exact.prevent="onKeydownEnter">
8989
{{ answer.text }}
9090
</NcCheckboxRadioSwitch>
9191
<div v-if="allowOtherAnswer" class="question__other-answer">
9292
<NcCheckboxRadioSwitch
93-
:checked="questionValues"
93+
:model-value="questionValues"
9494
:aria-errormessage="hasError ? errorId : undefined"
9595
:aria-invalid="hasError ? 'true' : undefined"
9696
:value="otherAnswer ?? QUESTION_EXTRASETTINGS_OTHER_PREFIX"
9797
:name="`${id}-answer`"
9898
:type="isUnique ? 'radio' : 'checkbox'"
9999
:required="checkRequired('other-answer')"
100100
class="question__label"
101-
@update:checked="onChangeOther"
101+
@update:modelValue="onChangeOther"
102102
@keydown.enter.exact.prevent="onKeydownEnter">
103103
{{ t('forms', 'Other:') }}
104104
</NcCheckboxRadioSwitch>
@@ -345,7 +345,7 @@ export default {
345345
},
346346
347347
onChange(value) {
348-
this.$emit('update:values', this.isUnique ? [value].flat() : value)
348+
this.$emit('update:values', this.isUnique ? [value].flat() : value)
349349
},
350350
351351
/**

0 commit comments

Comments
 (0)