|
41 | 41 | class="ranking-unranked__pool" |
42 | 42 | :animation="300" |
43 | 43 | :group="'ranking_' + id" |
44 | | - @end="emitValues"> |
45 | | - <button |
46 | | - v-for="option in unrankedOptions" |
47 | | - :key="option.id" |
48 | | - class="ranking-unranked__item" |
49 | | - @click="rankOption(option)"> |
50 | | - {{ option.text }} |
51 | | - </button> |
| 44 | + target=".sort-target" |
| 45 | + direction="horizontal" |
| 46 | + @start="onRankingStart" |
| 47 | + @end="onRankingEnd"> |
| 48 | + <TransitionGroup |
| 49 | + tag="ul" |
| 50 | + :name="isRanking ? undefined : 'options-list-transition'" |
| 51 | + class="sort-target"> |
| 52 | + <li v-for="option in unrankedOptions" :key="option.id"> |
| 53 | + <button |
| 54 | + type="button" |
| 55 | + class="ranking-unranked__item" |
| 56 | + @click="rankOption(option)"> |
| 57 | + {{ option.text }} |
| 58 | + </button> |
| 59 | + </li> |
| 60 | + </TransitionGroup> |
52 | 61 | </Draggable> |
53 | 62 | <p v-else class="ranking-unranked__empty"> |
54 | 63 | {{ t('forms', 'All options ranked') }} |
|
68 | 77 | target=".sort-target" |
69 | 78 | direction="vertical" |
70 | 79 | handle=".ranking-item__drag-handle" |
| 80 | + @start="onRankingStart" |
71 | 81 | @end="onRankingEnd"> |
72 | 82 | <TransitionGroup |
73 | 83 | tag="ul" |
74 | | - :name="isDragging ? undefined : 'options-list-transition'" |
| 84 | + :name="isRanking ? undefined : 'options-list-transition'" |
75 | 85 | class="sort-target"> |
76 | 86 | <li |
77 | 87 | v-for="(option, index) in rankedOptions" |
@@ -235,6 +245,7 @@ export default { |
235 | 245 | return { |
236 | 246 | errorMessage: null, |
237 | 247 | isDragging: false, |
| 248 | + isRanking: false, |
238 | 249 | isLoading: false, |
239 | 250 | isOptionDialogShown: false, |
240 | 251 | rankedOptions: [], |
@@ -412,10 +423,17 @@ export default { |
412 | 423 | }) |
413 | 424 | }, |
414 | 425 |
|
| 426 | + onRankingStart() { |
| 427 | + this.isRanking = true |
| 428 | + }, |
| 429 | +
|
415 | 430 | /** |
416 | 431 | * Emit the current ranking after a drag reorder |
417 | 432 | */ |
418 | 433 | onRankingEnd() { |
| 434 | + this.$nextTick(() => { |
| 435 | + this.isRanking = false |
| 436 | + }) |
419 | 437 | this.emitValues() |
420 | 438 | }, |
421 | 439 |
|
@@ -482,6 +500,10 @@ export default { |
482 | 500 | font-style: italic; |
483 | 501 | padding: var(--default-grid-baseline) 0; |
484 | 502 | } |
| 503 | +
|
| 504 | + li { |
| 505 | + display: inline-block; |
| 506 | + } |
485 | 507 | } |
486 | 508 |
|
487 | 509 | .ranking-ranked { |
|
0 commit comments