feathersui-starling
feathersui-starling copied to clipboard
PickerList does not work when above Away3D View3D
using MetalWorksDesktopTheme on PC
- Make, for example, a panel, add a PickerList there with some items in data provider.
- Establish Away3D View3D with size of the screen
- Open the PickerList using mouse in a way so items appear above Away3D View3D.
- Try to pick an item
Expected result: new item is selected Actual result: selected item is not changed
P.S. Other components with pop-ups like in PickerList are probably affected too
It's likely that Away3D adds something to the native stage that can receive focus. If a native display object that can receive focus is above a Feathers component, then the FocusManager will give it precedence. From DefaultFocusManager:
protected function stage_mouseFocusChangeHandler(event:FocusEvent):void
{
if(event.relatedObject)
{
//we need to allow mouse focus to be passed to native display
//objects. for instance, hyperlinks in TextField won't work
//unless the TextField can be focused.
this.focus = null;
return;
}
event.preventDefault();
}
As noted in the comment there, certain functionality can break if things on the native display object aren't allowed to have focus. The bit about TextFields is particularly important for the Feathers ScrollText component. However, it would certainly affect other interactive display objects on the native stage too.
An easy way to check if this is what's happening would be to disable the FocusManager after you instantiate MetalWorksDesktopTheme.
FocusManager.setEnabledForStage(this.stage, false);
The PickerList should become properly interactive again because the focus manager won't clearing its focus from its pop-up list. However, keyboard navigation with the tab key will no longer work. That may or may not be acceptable.
Unfortunately, I'm not sure if there's a good way to exclude some native stage display objects from the focus manager's default behavior. I'll have to think about it.
Instant as always, thank you Josh!