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">
|
||||
{{ currentValue.title }}
|
||||
</p>
|
||||
<p v-else>Selectionnez une déclinaison</p>
|
||||
<p v-else>Sélectionnez une déclinaison</p>
|
||||
</template>
|
||||
|
||||
<template #option="slotProps">
|
||||
|
|
@ -94,7 +94,13 @@ watch(
|
|||
() => isCompareModeEnabled,
|
||||
(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(
|
||||
activeTracks,
|
||||
(newValue) => {
|
||||
if (!isCompareModeEnabled) return;
|
||||
if (!isCompareModeEnabled || !currentValue.value) return;
|
||||
|
||||
currentValue.value.forEach((item) => {
|
||||
if (!newValue.includes(item)) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<figure :style="'--bg-color:' + activeTrack.backgroundColor">
|
||||
<div
|
||||
@mousedown="enableDragToRotate"
|
||||
@touchstart="enableDragToRotate"
|
||||
@touchstart.passive="enableDragToRotate"
|
||||
class="drag-zone"
|
||||
:class="{ grabbing: isDragToRotateEnabled }"
|
||||
></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue