mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 05:09:40 +02:00
fix: recipe ingredient editor bugs (#1251)
* filter unallowed fields #1140 * fix type and layout * propery validate none type quantites * fix rendering error #1237
This commit is contained in:
parent
d06d4d2fd9
commit
cd0da36e7c
5 changed files with 47 additions and 22 deletions
|
@ -10,11 +10,8 @@
|
|||
<v-divider v-if="showTitleEditor[index]"></v-divider>
|
||||
<v-list-item dense @click="toggleChecked(index)">
|
||||
<v-checkbox hide-details :value="checked[index]" class="pt-0 my-auto py-auto" color="secondary" />
|
||||
<v-list-item-content>
|
||||
<VueMarkdown
|
||||
class="ma-0 pa-0 text-subtitle-1 dense-markdown"
|
||||
:source="parseIngredientText(ingredient, disableAmount, scale)"
|
||||
/>
|
||||
<v-list-item-content :key="ingredient.quantity">
|
||||
<VueMarkdown class="ma-0 pa-0 text-subtitle-1 dense-markdown" :source="ingredientDisplay[index]" />
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</div>
|
||||
|
@ -58,11 +55,7 @@ export default defineComponent({
|
|||
});
|
||||
|
||||
const ingredientCopyText = computed(() => {
|
||||
return props.value
|
||||
.map((ingredient) => {
|
||||
return `- [ ] ${parseIngredientText(ingredient, props.disableAmount, props.scale)}`;
|
||||
})
|
||||
.join("\n");
|
||||
return ingredientDisplay.value.join("\n");
|
||||
});
|
||||
|
||||
function toggleChecked(index: number) {
|
||||
|
@ -71,7 +64,14 @@ export default defineComponent({
|
|||
state.checked.splice(index, 1, !state.checked[index]);
|
||||
}
|
||||
|
||||
const ingredientDisplay = computed(() => {
|
||||
return props.value.map((ingredient) => {
|
||||
return `${parseIngredientText(ingredient, props.disableAmount, props.scale)}`;
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
ingredientDisplay,
|
||||
...toRefs(state),
|
||||
parseIngredientText,
|
||||
ingredientCopyText,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue