From 9a319a6ee017b0391431600be57cab8cbf037467 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 23 Dec 2024 17:31:22 +0100 Subject: [PATCH] Fixed/optimized shopping list invalidation when removing table rows (fixes #2608) --- changelog/76_UNRELEASED_xxxx-xx-xx.md | 1 + public/viewjs/shoppinglist.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/76_UNRELEASED_xxxx-xx-xx.md b/changelog/76_UNRELEASED_xxxx-xx-xx.md index bb23e119..b874c9ad 100644 --- a/changelog/76_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/76_UNRELEASED_xxxx-xx-xx.md @@ -23,6 +23,7 @@ ### Shopping list - Fixed that when printing a shoppping list the table/list wasn't sorted (will now be sorted alphabetically by the product name of the corresponding list item) +- Fixed that when deleting a shopping list item and marking another one as done while not reloading the page in-between, the deleted item reappeared (was only a visual problem, there was no problem on deleting the item on the backend / in the database) ### Recipes diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 83661191..910e6b34 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -132,7 +132,7 @@ $(document).on('click', '.shoppinglist-delete-button', function(e) animateCSS("#shoppinglistitem-" + shoppingListItemId + "-row", "fadeOut", function() { Grocy.FrontendHelpers.EndUiBusy(); - $("#shoppinglistitem-" + shoppingListItemId + "-row").remove(); + $("#shoppinglistitem-" + shoppingListItemId + "-row").addClass("d-none").remove(); OnListItemRemoved(); }); },