Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Apache Flex 4.9.0
-
None
Description
When changing MenuBar dataProvider within click on Menu sometimes causes a TypeError in mouseOutHandler.
I solved this with following workaround:
public override function addChild(child:DisplayObject):DisplayObject
{
if( child is IMenuBarItemRenderer )
return super.addChild( child );
}
private function patchedMouseOutHandler( event: MouseEvent ) : void
{
//stop the event to avoid npe
event.stopImmediatePropagation();
event.stopPropagation();
var item:IMenuBarItemRenderer = IMenuBarItemRenderer(event.target);
var index:int = item.menuBarItemIndex;
var m:Menu = getMenuAt(index);
if (item.enabled && selectedIndex != index)
{ if( menuBarItems.indexOf( item ) >= 0 ) menuBarItems[index].menuBarItemState = "itemUpSkin"; } // Fire the appropriate rollout event
if (item.data &&
(m.dataDescriptor.getType(item.data) != "separator"))
}