Fix tab selection bug
authorRichard Fairhurst <richard@systemeD.net>
Fri, 17 Jun 2011 08:55:20 +0000 (09:55 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 17 Jun 2011 08:55:20 +0000 (09:55 +0100)
net/systemeD/potlatch2/TagViewer.mxml

index d477a57d3a8dcf373ade8f9098632bfd4ed28f49..3aa7448054806782909699e83bd0488973d29fdb 100644 (file)
       import mx.events.DragEvent;
       import mx.managers.DragManager;
       import mx.core.DragSource;
+      import mx.controls.TabBar;
       import flexlib.containers.SuperTabNavigator;
 
       [Bindable]
       private var tabComponents:Object = {};
 
       private function initialiseEditors():void {
+          // reset tab to 0 to work around TabNavigator bug (#3444)
+          if (editorStack is TabNavigator) {
+              try {
+                  var tabBar:TabBar=TabBar(TabNavigator(editorStack).getTabAt(0).parent);
+                  tabBar.selectedIndex=0;
+              } catch(errObject:Error) {}
+          }
+
           editorStack.removeAllChildren();
           if ( selectedEntity == null || feature == null )
               return;