This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 986bae16e8 Multi-select list: no change event unless indices actually 
changed
986bae16e8 is described below

commit 986bae16e8b31cc7c364118568d51233b5b26488
Author: Yishay Weiss <[email protected]>
AuthorDate: Wed Mar 15 11:43:24 2023 +0200

    Multi-select list: no change event unless indices actually changed
---
 .../html/beads/controllers/ListMultiSelectionMouseController.as   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ListMultiSelectionMouseController.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ListMultiSelectionMouseController.as
index e6fb419a6d..eaa6a25e6f 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ListMultiSelectionMouseController.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ListMultiSelectionMouseController.as
@@ -35,6 +35,7 @@ package org.apache.royale.html.beads.controllers
        import org.apache.royale.utils.sendEvent;
        import org.apache.royale.core.Bead;
        import org.apache.royale.html.util.getModelByType;
+       import org.apache.royale.utils.array.arraysMatch;
 
        /**
         *  The ListMultiSelectionMouseController class is a controller for
@@ -165,8 +166,11 @@ package org.apache.royale.html.beads.controllers
                                        newIndices.push(from++);
                                }
                        }
-                       listModel.selectedIndices = newIndices;
-                       sendEvent(listView.host,"change");
+                       if (!arraysMatch(listModel.selectedIndices, newIndices))
+                       {
+                               listModel.selectedIndices = newIndices;
+                               sendEvent(listView.host,"change");
+                       }
                }
 
                private function getMin(value:Array):int

Reply via email to