multiselect : leave compare mode ok
This commit is contained in:
parent
651774ac8a
commit
d41a05d367
2 changed files with 10 additions and 4 deletions
|
|
@ -44,7 +44,7 @@
|
||||||
<p v-if="currentValue">
|
<p v-if="currentValue">
|
||||||
{{ currentValue.title }}
|
{{ currentValue.title }}
|
||||||
</p>
|
</p>
|
||||||
<p v-else>Selectionnez une déclinaison</p>
|
<p v-else>Sélectionnez une déclinaison</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #option="slotProps">
|
<template #option="slotProps">
|
||||||
|
|
@ -94,7 +94,13 @@ watch(
|
||||||
() => isCompareModeEnabled,
|
() => isCompareModeEnabled,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
currentValue.value = currentValue.value ? [currentValue.value] : null;
|
if (currentValue.value && !Array.isArray(currentValue.value)) {
|
||||||
|
currentValue.value = [currentValue.value];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Array.isArray(currentValue.value)) {
|
||||||
|
currentValue.value = currentValue.value[0] || null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -111,7 +117,7 @@ watch(currentValue, (newValue) => {
|
||||||
watch(
|
watch(
|
||||||
activeTracks,
|
activeTracks,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (!isCompareModeEnabled) return;
|
if (!isCompareModeEnabled || !currentValue.value) return;
|
||||||
|
|
||||||
currentValue.value.forEach((item) => {
|
currentValue.value.forEach((item) => {
|
||||||
if (!newValue.includes(item)) {
|
if (!newValue.includes(item)) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<figure :style="'--bg-color:' + activeTrack.backgroundColor">
|
<figure :style="'--bg-color:' + activeTrack.backgroundColor">
|
||||||
<div
|
<div
|
||||||
@mousedown="enableDragToRotate"
|
@mousedown="enableDragToRotate"
|
||||||
@touchstart="enableDragToRotate"
|
@touchstart.passive="enableDragToRotate"
|
||||||
class="drag-zone"
|
class="drag-zone"
|
||||||
:class="{ grabbing: isDragToRotateEnabled }"
|
:class="{ grabbing: isDragToRotateEnabled }"
|
||||||
></div>
|
></div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue