diff --git a/src/features/forms/components/inputs/RepeatInput.vue b/src/features/forms/components/inputs/RepeatInput.vue index 0d73dceee10805d3e190e72a38d41efab1b1d3ad..7c541a43de0fb84f23db24d4034bba69f3e5854f 100644 --- a/src/features/forms/components/inputs/RepeatInput.vue +++ b/src/features/forms/components/inputs/RepeatInput.vue @@ -133,6 +133,14 @@ function dragOver(event: DragEvent) { document.body.classList.add('cursor-move'); } +// Used to get "choice left/right" on swipe choice +function getLabelIdentifier(index) { + if(props.addButton === false) { + return index === 0 ? 'droite' : 'gauche'; + } + else return index + 1; +} + </script> <template> @@ -161,7 +169,7 @@ function dragOver(event: DragEvent) { <div class="form-icon"><i :class="element.action.icon"></i></div> <h3>{{ element.action.label }}</h3> </div> - <h3 v-else>{{ label }} {{ index + 1 }}</h3> + <h3 v-else>{{ label }} {{ getLabelIdentifier(index) }}</h3> <div v-if="addButton !== false" class="card-header-icon"> <i class="icon-supprimer delete" @click.stop="removeCard(index)"></i> <hr v-if="!(isLast(index) && index === 0)" class="vertical-separator"> diff --git a/src/shared/data/forms/questionsForm.data.ts b/src/shared/data/forms/questionsForm.data.ts index 01c1fa785756c2d25fff0b69d108f1b4a9b90a40..517a7cb2f46830a09662c68155ef64c19a6bce21 100644 --- a/src/shared/data/forms/questionsForm.data.ts +++ b/src/shared/data/forms/questionsForm.data.ts @@ -317,7 +317,7 @@ export const swipeForm: Form = { id: 'categories', label: 'Choix', type: 'repeat', - value: ['Gauche', 'Droite'], + value: ['Droite', 'Gauche'], addButton: false, inputs: [ {