haxeui-openfl
haxeui-openfl copied to clipboard
Textarea event bug in Flash target
Current Behavior
When you click on the scrollbar-thumb to scroll the text in a textarea the following error occurs for the flash target. (Not an issue for the android target.)
Error #1034: Type Coercion failed: cannot convert haxe.ui.events::FocusEvent@6e608d1 to haxe.ui.events.MouseEvent.
haxe.ui.util::EventMap/invoke at ...\haxe\lib\haxeui-core\git\haxe\ui\util\EventMap.hx:70 haxe.ui.core::ComponentEvents/dispatch at ...\haxe\lib\haxeui-core\git\haxe\ui\core\ComponentEvents.hx:92 haxe.ui.core::InteractiveComponent/set_focus at ...\haxe\lib\haxeui-core\git\haxe\ui\core\InteractiveComponent.hx:49 haxe.ui.components._TextArea::Events/onMouseDown at ...\haxe\lib\haxeui-core\git\haxe\ui\components\TextArea.hx:300 haxe.ui.util::EventMap/invoke at ...\haxe\lib\haxeui-core\git\haxe\ui\util\EventMap.hx:70 haxe.ui.core::ComponentEvents/dispatch at ...\haxe\lib\haxeui-core\git\haxe\ui\core\ComponentEvents.hx:92 haxe.ui.core::ComponentEvents/_onMappedEvent at ...\haxe\lib\haxeui-core\git\haxe\ui\core\ComponentEvents.hx:101 haxe.ui.backend::ComponentImpl/__onMouseEvent at ...\haxe\lib\haxeui-openfl\git\haxe\ui\backend\ComponentImpl.hx:273
Steps to Reproduce (for bugs)
- Just take the most basic haxeui example and add a textarea.
<vbox> <label id="label1" text="Simple HaxeUI application" /> <button text="Click me!" onClick=" label1.text='Button clicked!' " /> <textarea text="1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n"/> </vbox>
`import haxe.ui.Toolkit; import haxe.ui.HaxeUIApp; import haxe.ui.core.Screen; import haxe.ui.core.Component; import haxe.ui.macros.ComponentMacros;
class Main { public static function main() { Toolkit.init(); var app = new HaxeUIApp(); app.ready(function() { var main:Component = ComponentMacros.buildComponent("Assets/UI.xml"); app.addComponent(main); app.start(); }); } } `
Same problem on HashLink backend, simple click on textarea leads to crash. Neko/CPP is fine.