You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/12/05 00:07:46 UTC

[royale-asjs] branch develop updated: fit in range as Flex did. Should fix #606 case 3

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

aharui 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 3b35dc2  fit in range as Flex did.  Should fix #606 case 3
3b35dc2 is described below

commit 3b35dc20871b832bdd627c8b4cfcec974a80d954
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Dec 4 16:07:31 2019 -0800

    fit in range as Flex did.  Should fix #606 case 3
---
 .../beads/models/SingleSelectionICollectionViewModel.as       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/SingleSelectionICollectionViewModel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/SingleSelectionICollectionViewModel.as
index 6098ee3..62a3992 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/SingleSelectionICollectionViewModel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/SingleSelectionICollectionViewModel.as
@@ -186,13 +186,14 @@ package mx.controls.beads.models
 			{
 				_selectedItem = null;
 			}
-			else if (value < dataProvider.length)
-			{
-				_selectedItem = getItemAt(value);
-			}
 			else
 			{
-				_selectedItem = null;
+                if (value >= dataProvider.length)
+                {
+                    value = dataProvider.length - 1;
+                    _selectedIndex = value;
+                }
+				_selectedItem = getItemAt(value);
 			}
 
 			dispatchEvent(new Event("selectedIndexChanged"));