1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 13:35:23 +02:00

fix: Manual Serving Edits (#5813)

This commit is contained in:
Michael Genson 2025-07-28 10:54:59 -05:00 committed by GitHub
parent f8cb80ed7f
commit fa5bc17ed8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,12 +66,12 @@
<v-card-text class="mt-n5"> <v-card-text class="mt-n5">
<div class="mt-4 d-flex align-center"> <div class="mt-4 d-flex align-center">
<v-text-field <v-text-field
:model-value="yieldQuantityEditorValue" :model-value="yieldQuantity"
type="number" type="number"
:min="0" :min="0"
variant="underlined" variant="underlined"
hide-spin-buttons hide-spin-buttons
@update:model-value="recalculateScale(yieldQuantityEditorValue)" @update:model-value="recalculateScale(parseFloat($event) || 0)"
/> />
<v-tooltip <v-tooltip
end end
@ -81,6 +81,7 @@
<v-btn <v-btn
v-bind="props" v-bind="props"
icon icon
flat
class="mx-1" class="mx-1"
size="small" size="small"
@click="scale = 1" @click="scale = 1"
@ -178,21 +179,8 @@ export default defineNuxtComponent({
: ""; : "";
}); });
// only update yield quantity when the menu opens, so we don't override the user's input
const yieldQuantityEditorValue = ref(recipeYieldAmount.value.scaledAmount);
watch(
() => menu.value,
() => {
if (!menu.value) {
return;
}
yieldQuantityEditorValue.value = recipeYieldAmount.value.scaledAmount;
},
);
const disableDecrement = computed(() => { const disableDecrement = computed(() => {
return recipeYieldAmount.value.scaledAmount <= 1; return yieldQuantity.value <= 1;
}); });
return { return {
@ -202,7 +190,6 @@ export default defineNuxtComponent({
recalculateScale, recalculateScale,
yieldDisplay, yieldDisplay,
yieldQuantity, yieldQuantity,
yieldQuantityEditorValue,
disableDecrement, disableDecrement,
}; };
}, },