From e4c25d362b8e5df282a02297b7e8d6cdcb787a95 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Tue, 11 Feb 2025 15:46:00 +0100
Subject: [PATCH] fix(save-button): ignore not work with arrays #292

---
 source/components/datatable/save-button.mjs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/source/components/datatable/save-button.mjs b/source/components/datatable/save-button.mjs
index ca31f3967..3d0fa8849 100644
--- a/source/components/datatable/save-button.mjs
+++ b/source/components/datatable/save-button.mjs
@@ -205,7 +205,9 @@ class SaveButton extends CustomElement {
 					const result = diff(self[originValuesSymbol], currentValues);
 					if (self.getOption("logLevel") === "debug") {
 						console.groupCollapsed("SaveButton");
-						console.log(result);
+						console.log("originValues", JSON.parse(JSON.stringify(currentValues)));
+						console.log("result of diff", result);
+						console.log("ignoreChanges", ignoreChanges);
 
 						if (isArray(result) && result.length > 0) {
 							const formattedDiff = result.map((change) => ({
@@ -229,7 +231,13 @@ class SaveButton extends CustomElement {
 						for (const item of result) {
 							for (const ignorePattern of ignoreChanges) {
 								const p = new RegExp(ignorePattern);
-								if (p.test(item.path)) {
+
+								let matchPath = item.path
+								if(isArray(item.path)){
+									matchPath = item.path.join(".");
+								}
+
+								if (p.test(matchPath)) {
 									itemsToRemove.push(item);
 									break;
 								}
-- 
GitLab