From 836614bf4fec951fbfd218c3645bc205871bcf81 Mon Sep 17 00:00:00 2001 From: Kostiantyn Miakshyn Date: Fri, 23 Jan 2026 15:20:16 +0100 Subject: [PATCH] fix: dropdown anc checkboxes fields are broken after grid type introduction Signed-off-by: Kostiantyn Miakshyn --- src/components/Questions/QuestionDropdown.vue | 8 ++--- src/components/Questions/QuestionGrid.vue | 2 ++ src/components/Questions/QuestionMultiple.vue | 34 +++++++++++++------ src/mixins/QuestionMultipleMixin.ts | 8 ++--- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/components/Questions/QuestionDropdown.vue b/src/components/Questions/QuestionDropdown.vue index c1bc14ac0..79025399e 100644 --- a/src/components/Questions/QuestionDropdown.vue +++ b/src/components/Questions/QuestionDropdown.vue @@ -49,7 +49,7 @@ handle=".option__drag-handle" invert-swap tag="ul" - @change="saveOptionsOrder" + @change="saveOptionsOrder('choice')" @start="isDragging = true" @end="isDragging = false"> + @move-up="onOptionMoveUp(index, 'choice')" + @move-down="onOptionMoveDown(index, 'choice')" + @tabbed-out="checkValidOption('choice')" /> diff --git a/src/components/Questions/QuestionGrid.vue b/src/components/Questions/QuestionGrid.vue index d83d40379..2f68ebaad 100644 --- a/src/components/Questions/QuestionGrid.vue +++ b/src/components/Questions/QuestionGrid.vue @@ -184,6 +184,7 @@ import NcInputField from '@nextcloud/vue/components/NcInputField' import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon' import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' import AnswerInput from './AnswerInput.vue' +import Question from './Question.vue' import QuestionMixin from '../../mixins/QuestionMixin.js' import QuestionMultipleMixin from '../../mixins/QuestionMultipleMixin.ts' import { GridCellType, OptionType } from '../../models/Constants.ts' @@ -198,6 +199,7 @@ export default { NcInputField, NcLoadingIcon, NcNoteCard, + Question, }, mixins: [QuestionMixin, QuestionMultipleMixin], diff --git a/src/components/Questions/QuestionMultiple.vue b/src/components/Questions/QuestionMultiple.vue index 258c56d29..f4b0d1ea3 100644 --- a/src/components/Questions/QuestionMultiple.vue +++ b/src/components/Questions/QuestionMultiple.vue @@ -47,9 +47,7 @@ :model-value="!!extraSettings?.optionsLimitMax" @update:model-value=" (checked) => - onLimitOptionsMax( - checked ? sortedOptions.length || 1 : null, - ) + onLimitOptionsMax(checked ? choices.length || 1 : null) "> {{ t('forms', 'Require a maximum of options to be checked') }} @@ -75,7 +73,7 @@ {{ errorMessage }} + @move-up="onOptionMoveUp(index, 'choice')" + @move-down="onOptionMoveDown(index, 'choice')" + @tabbed-out="checkValidOption('choice')" />