You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/10/11 01:18:25 UTC

[1/2] git commit: [flex-sdk] [refs/heads/release4.11.0] - FLEX-33772 Incorrect tab focus behaviour

Updated Branches:
  refs/heads/release4.11.0 8eddfd0fa -> 53d547170


FLEX-33772 Incorrect tab focus behaviour


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/edb146e5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/edb146e5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/edb146e5

Branch: refs/heads/release4.11.0
Commit: edb146e5aac2fe6db826925fd680e82dad6132f4
Parents: 8eddfd0
Author: Justin Mclean <jm...@apache.org>
Authored: Fri Oct 11 10:16:36 2013 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Fri Oct 11 10:16:36 2013 +1100

----------------------------------------------------------------------
 .../framework/src/mx/managers/FocusManager.as   | 95 ++++++++++++++++----
 1 file changed, 79 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/edb146e5/frameworks/projects/framework/src/mx/managers/FocusManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/managers/FocusManager.as b/frameworks/projects/framework/src/mx/managers/FocusManager.as
index 4af19fd..6f17a07 100644
--- a/frameworks/projects/framework/src/mx/managers/FocusManager.as
+++ b/frameworks/projects/framework/src/mx/managers/FocusManager.as
@@ -1379,29 +1379,92 @@ public class FocusManager extends EventDispatcher implements IFocusManager
                 var o:DisplayObject = DisplayObject(findFocusManagerComponent2(focusableCandidates[i]));     
                 if (o is IFocusManagerGroup)
                 {
-                    // look around to see if there's an enabled and visible
-                    // selected member in the tabgroup, otherwise use the first
-                    // one we found.
+                    
+                    // when landing on an element that is part of group, try to
+                    // advance selection to the selected group element
+                    var j:int;
+                    var obj:DisplayObject;
                     var tg1:IFocusManagerGroup = IFocusManagerGroup(o);
-                    for (var j:int = 0; j < focusableCandidates.length; j++)
+                    var tg2:IFocusManagerGroup;
+                    
+                    // normalize the "no selected group element" case
+                    // to the "first group element selected" case
+                    // (respecting the tab direction)
+                    var groupElementToFocus:IFocusManagerGroup = null;
+                    for (j = 0; j < focusableCandidates.length; j++)
                     {
-                        var obj:DisplayObject = focusableCandidates[j];
-                        if (obj is IFocusManagerGroup && isEnabledAndVisible(obj))
+                        obj = focusableCandidates[j];
+                        if (obj is IFocusManagerGroup)
                         {
-                            var tg2:IFocusManagerGroup = IFocusManagerGroup(obj);
-                            if (tg2.groupName == tg1.groupName && tg2.selected)
+                            tg2 = IFocusManagerGroup(obj);
+                            if (tg2.groupName == tg1.groupName && isEnabledAndVisible(obj))
                             {
-                                // if objects of same group have different tab index
-                                // skip you aren't selected.
-                                if (InteractiveObject(obj).tabIndex != InteractiveObject(o).tabIndex && !tg1.selected)
-                                    return getIndexOfNextObject(i, shiftKey, bSearchAll, groupName);
-
-                                i = j;
-                                break;
+                                if (tg2.selected) 
+                                {
+                                    groupElementToFocus = tg2;
+                                    break;
+                                }
+                                if ((!shiftKey && groupElementToFocus == null) || shiftKey)
+                                    groupElementToFocus = tg2;
+                            }
+                        }
+                    }
+                    
+                    if (tg1 != groupElementToFocus)
+                    {
+                        // cycle the entire focusable candidates array forward or backward,
+                        // wrapping around boundaries, searching for our focus candidate
+                        j = i;
+                        for (var k:int = 0; k < focusableCandidates.length - 1; k++)
+                        {
+                            
+                            if (!shiftKey) 
+                            {
+                                j++;
+                                if (j == focusableCandidates.length)
+                                    j = 0;
+                            }
+                            else
+                            {
+                                j--;
+                                if (j == -1)
+                                    j = focusableCandidates.length - 1;
+                            }
+                            
+                            obj = focusableCandidates[j];
+                            if (isEnabledAndVisible(obj))
+                            {
+                                if (obj is IFocusManagerGroup)
+                                {
+                                    tg2 = IFocusManagerGroup(obj);
+                                    if (tg2.groupName == tg1.groupName)
+                                    {
+                                        if (tg2 == groupElementToFocus)
+                                        {
+                                            // if objects of same group have different tab index
+                                            // skip you aren't selected.
+                                            if (InteractiveObject(obj).tabIndex != InteractiveObject(o).tabIndex && !tg1.selected)
+                                                return getIndexOfNextObject(i, shiftKey, bSearchAll, groupName);
+                                            i = j;
+                                            break;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        // element is part of another group, stop (no recursive search)
+                                        i = j;
+                                        break;
+                                    }
+                                }
+                                else
+                                {
+                                    // element isn't part of any group, stop
+                                    i = j;
+                                    break;
+                                }
                             }
                         }
                     }
-
                 }
                 return i;
             }


[2/2] git commit: [flex-sdk] [refs/heads/release4.11.0] - updated release emotes with latest JIRA

Posted by jm...@apache.org.
updated release emotes with latest JIRA


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53d54717
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53d54717
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53d54717

Branch: refs/heads/release4.11.0
Commit: 53d5471708c2bb1caa17f36d438d79ea45551593
Parents: edb146e
Author: Justin Mclean <jm...@apache.org>
Authored: Fri Oct 11 10:18:08 2013 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Fri Oct 11 10:18:08 2013 +1100

----------------------------------------------------------------------
 RELEASE_NOTES | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53d54717/RELEASE_NOTES
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 3fed715..59480cc 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -71,6 +71,7 @@ FLEX-33801  Missing embedded examples in ASDOC on flex.apache.org/asdoc/
 FLEX-33789  Logical error: self-reference in GridHeaderViewLayout
 FLEX-33783  mxmlc -help returns 1
 FLEX-33782  AccordionData labelField and labelFunction properties don't work
+FLEX-33772  Incorrect tab focus behavior (closed loops) when using focus groups (such as RadioButton components)
 FLEX-33771  compatibilityVersionString returns the wrong value
 FLEX-33748  TabBar shouldn't be colorized in TabNavigatorSkin
 FLEX-33741  Propagation of Escape key in mx.controls.DateField should only be stopped if the DropDown is shown