From 59e8e4fcc708005c46d45966a7394d50c9d01add Mon Sep 17 00:00:00 2001 From: Yauheni Balashka Date: Tue, 1 Jul 2025 17:35:23 +0300 Subject: [PATCH] Update passedElement.value after removing item --- src/scripts/choices.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripts/choices.ts b/src/scripts/choices.ts index a4f79e4d..57d3f4b7 100644 --- a/src/scripts/choices.ts +++ b/src/scripts/choices.ts @@ -1227,6 +1227,8 @@ class Choices { this._store.withTxn(() => { // Remove item associated with button this._removeItem(itemToRemove); + const passedElementValueModified = this.passedElement.value.split(",").filter(x=> x !== itemToRemove.value) + this.passedElement.value = passedElementValueModified.join(",") this._triggerChange(itemToRemove.value); if (this._isSelectOneElement && !this._hasNonChoicePlaceholder) {