You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/09/16 21:26:47 UTC

[royale-asjs] branch develop updated: avoid List throw change event when user define selectedIndex

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

carlosrovira 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 a7097e2  avoid List throw change event when user define selectedIndex
a7097e2 is described below

commit a7097e2c5053393fd6ccfb0abb52b1be0daac086
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Sep 16 23:26:40 2018 +0200

    avoid List throw change event when user define selectedIndex
---
 .../src/main/royale/org/apache/royale/jewel/beads/views/ListView.as  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
index b971fb7..e9e802b 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
@@ -124,7 +124,10 @@ package org.apache.royale.jewel.beads.views
 
 			lastSelectedIndex = listModel.selectedIndex;
 
-			IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
+			// avoid throw change event as part of select proper item at initialization time
+			if(event != null) {
+				IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
+			}
 		}
 
 		protected var lastRollOverIndex:int = -1;