From: Richard Fairhurst Date: Fri, 17 Jun 2011 08:55:20 +0000 (+0100) Subject: Fix tab selection bug X-Git-Tag: 2.2~1^2~3 X-Git-Url: https://git.openstreetmap.org/potlatch2.git/commitdiff_plain/8f4239262c5e7ab762c194e4bf34997d9c722543 Fix tab selection bug --- diff --git a/net/systemeD/potlatch2/TagViewer.mxml b/net/systemeD/potlatch2/TagViewer.mxml index d477a57d..3aa74480 100644 --- a/net/systemeD/potlatch2/TagViewer.mxml +++ b/net/systemeD/potlatch2/TagViewer.mxml @@ -230,6 +230,7 @@ import mx.events.DragEvent; import mx.managers.DragManager; import mx.core.DragSource; + import mx.controls.TabBar; import flexlib.containers.SuperTabNavigator; [Bindable] @@ -379,6 +380,14 @@ 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;