|
96 | 96 | <Draggable |
97 | 97 | v-model="columns" |
98 | 98 | class="question__content" |
99 | | - :animation="200" |
| 99 | + :animation="300" |
100 | 100 | direction="vertical" |
101 | 101 | handle=".option__drag-handle" |
102 | 102 | invertSwap |
103 | | - tag="transition-group" |
104 | | - :componentData="{ |
105 | | - name: isDragging |
106 | | - ? 'no-external-transition-on-drag' |
107 | | - : 'options-list-transition', |
108 | | - }" |
| 103 | + target=".sort-target" |
109 | 104 | @change="saveOptionsOrder('column')" |
110 | 105 | @start="isDragging = true" |
111 | 106 | @end="isDragging = false"> |
112 | 107 | <!-- Column input edit --> |
113 | | - <AnswerInput |
114 | | - v-for="(answer, index) in columns" |
115 | | - :key="answer.local ? 'option-local' : answer.id" |
116 | | - ref="input" |
117 | | - :answer="answer" |
118 | | - :formId="formId" |
119 | | - :index="index" |
120 | | - :isUnique="isUnique" |
121 | | - :maxIndex="columns.length - 2" |
122 | | - :maxOptionLength="maxStringLengths.optionText" |
123 | | - optionType="column" |
124 | | - @createAnswer="onCreateAnswer" |
125 | | - @update:answer="updateAnswer" |
126 | | - @delete="deleteOption" |
127 | | - @focusNext="focusNextInput" |
128 | | - @moveUp="onOptionMoveUp(index, 'column')" |
129 | | - @moveDown="onOptionMoveDown(index, 'column')" |
130 | | - @tabbedOut="checkValidOption('column')" /> |
| 108 | + <TransitionGroup |
| 109 | + tag="ul" |
| 110 | + :name="isDragging ? undefined : 'options-list-transition'" |
| 111 | + class="sort-target"> |
| 112 | + <AnswerInput |
| 113 | + v-for="(answer, index) in columns" |
| 114 | + :key="answer.local ? 'option-local' : answer.id" |
| 115 | + ref="input" |
| 116 | + :answer="answer" |
| 117 | + :formId="formId" |
| 118 | + :index="index" |
| 119 | + :isUnique="isUnique" |
| 120 | + :maxIndex="columns.length - 2" |
| 121 | + :maxOptionLength="maxStringLengths.optionText" |
| 122 | + optionType="column" |
| 123 | + @createAnswer="onCreateAnswer" |
| 124 | + @update:answer="updateAnswer" |
| 125 | + @delete="deleteOption" |
| 126 | + @focusNext="focusNextInput" |
| 127 | + @moveUp="onOptionMoveUp(index, 'column')" |
| 128 | + @moveDown="onOptionMoveDown(index, 'column')" |
| 129 | + @tabbedOut="checkValidOption('column')" /> |
| 130 | + </TransitionGroup> |
131 | 131 | </Draggable> |
132 | 132 |
|
133 | 133 | <div>{{ t('forms', 'Rows') }}</div> |
134 | 134 | <Draggable |
135 | 135 | v-model="rows" |
136 | 136 | class="question__content" |
137 | | - :animation="200" |
| 137 | + :animation="300" |
138 | 138 | direction="vertical" |
139 | 139 | handle=".option__drag-handle" |
140 | 140 | invertSwap |
141 | | - tag="transition-group" |
142 | | - :componentData="{ |
143 | | - name: isDragging |
144 | | - ? 'no-external-transition-on-drag' |
145 | | - : 'options-list-transition', |
146 | | - }" |
| 141 | + target=".sort-target" |
147 | 142 | @change="saveOptionsOrder('row')" |
148 | 143 | @start="isDragging = true" |
149 | 144 | @end="isDragging = false"> |
150 | | - <!-- Row input edit --> |
151 | | - <AnswerInput |
152 | | - v-for="(answer, index) in rows" |
153 | | - :key="answer.local ? 'option-local' : answer.id" |
154 | | - ref="input" |
155 | | - :answer="answer" |
156 | | - :formId="formId" |
157 | | - :index="index" |
158 | | - :isUnique="isUnique" |
159 | | - :maxIndex="rows.length - 2" |
160 | | - :maxOptionLength="maxStringLengths.optionText" |
161 | | - optionType="row" |
162 | | - @createAnswer="onCreateAnswer" |
163 | | - @update:answer="updateAnswer" |
164 | | - @delete="deleteOption" |
165 | | - @focusNext="focusNextInput" |
166 | | - @moveUp="onOptionMoveUp(index, 'row')" |
167 | | - @moveDown="onOptionMoveDown(index, 'row')" |
168 | | - @tabbedOut="checkValidOption('row')" /> |
| 145 | + <TransitionGroup |
| 146 | + tag="ul" |
| 147 | + :name="isDragging ? undefined : 'options-list-transition'" |
| 148 | + class="sort-target"> |
| 149 | + <!-- Row input edit --> |
| 150 | + <AnswerInput |
| 151 | + v-for="(answer, index) in rows" |
| 152 | + :key="answer.local ? 'option-local' : answer.id" |
| 153 | + ref="input" |
| 154 | + :answer="answer" |
| 155 | + :formId="formId" |
| 156 | + :index="index" |
| 157 | + :isUnique="isUnique" |
| 158 | + :maxIndex="rows.length - 2" |
| 159 | + :maxOptionLength="maxStringLengths.optionText" |
| 160 | + optionType="row" |
| 161 | + @createAnswer="onCreateAnswer" |
| 162 | + @update:answer="updateAnswer" |
| 163 | + @delete="deleteOption" |
| 164 | + @focusNext="focusNextInput" |
| 165 | + @moveUp="onOptionMoveUp(index, 'row')" |
| 166 | + @moveDown="onOptionMoveDown(index, 'row')" |
| 167 | + @tabbedOut="checkValidOption('row')" /> |
| 168 | + </TransitionGroup> |
169 | 169 | </Draggable> |
170 | 170 | </template> |
171 | 171 | </template> |
| 172 | + <template #insert> |
| 173 | + <slot name="insert" /> |
| 174 | + </template> |
172 | 175 | </Question> |
173 | 176 | </template> |
174 | 177 |
|
|
0 commit comments