mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 06:45:22 -07:00
fix drag and drop on recipe instructions
This commit is contained in:
parent
274c3efdd1
commit
d6b8f03c5b
1 changed files with 6 additions and 9 deletions
|
@ -130,11 +130,10 @@
|
||||||
ghostClass: 'ghost',
|
ghostClass: 'ghost',
|
||||||
}"
|
}"
|
||||||
@start="drag = true"
|
@start="drag = true"
|
||||||
@end="drag = false"
|
@end="onDragEnd"
|
||||||
>
|
>
|
||||||
<TransitionGroup
|
<TransitionGroup
|
||||||
type="transition"
|
type="transition"
|
||||||
:name="!drag ? 'flip-list' : ''"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(step, index) in instructionList"
|
v-for="(step, index) in instructionList"
|
||||||
|
@ -512,13 +511,10 @@ export default defineNuxtComponent({
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
function onDragEnd() {
|
||||||
instructionList,
|
context.emit("update:modelValue", [...instructionList.value]);
|
||||||
(newVal) => {
|
drag.value = false;
|
||||||
context.emit("update:modelValue", [...newVal]);
|
}
|
||||||
},
|
|
||||||
{ deep: true },
|
|
||||||
);
|
|
||||||
|
|
||||||
// ===============================================================
|
// ===============================================================
|
||||||
// Ingredient Linker
|
// Ingredient Linker
|
||||||
|
@ -784,6 +780,7 @@ export default defineNuxtComponent({
|
||||||
loadingStates,
|
loadingStates,
|
||||||
|
|
||||||
// Rest
|
// Rest
|
||||||
|
onDragEnd,
|
||||||
drag,
|
drag,
|
||||||
togglePreviewState,
|
togglePreviewState,
|
||||||
toggleCollapseSection,
|
toggleCollapseSection,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue