From 5663ae42b442cbb4e97b29dea78bde8077426e6b Mon Sep 17 00:00:00 2001 From: "Ahmad K. Bawaneh" Date: Mon, 15 Jul 2024 02:10:39 +0300 Subject: [PATCH] fix #939 calling clear value for multiselect box will repeat the call for change listener by the number of selected items. --- .../domino/ui/forms/suggest/AbstractSelect.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/AbstractSelect.java b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/AbstractSelect.java index e073e8a54..5232b5e5a 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/AbstractSelect.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/suggest/AbstractSelect.java @@ -277,11 +277,15 @@ protected C clearValue(boolean silent) { new ArrayList<>(selection) .forEach( item -> { - item.deselect(silent); - if (silent) { - OptionMeta.get(item) - .ifPresent(meta -> onOptionDeselected((O) meta.getOption(), silent)); - } + withPausedChangeListeners( + select -> { + item.deselect(silent); + if (silent) { + OptionMeta.get(item) + .ifPresent( + meta -> onOptionDeselected((O) meta.getOption(), silent)); + } + }); }); });