feathersui / feathersui-openfl

Cross-platform graphical user interface components for creative frontend projects — powered by Haxe and OpenFL
https://feathersui.com/
Other
160 stars 17 forks source link

Error on LongPress #74

Closed hansagames closed 2 years ago

hansagames commented 2 years ago

Hi, getting error when using long press util function

Code:

final group = new LayoutGroup();
... add some skin
this.addChild(group);

final longPress = new LongPress();
longPress.target = group;
group.addEventListener(LongPressEvent.LONG_PRESS, onLongPress);

after triggering long press getting error:

Uncaught TypeError: Cannot read properties of null (reading 'type')
    at Function.feathers_events_LongPressEvent.fromMouseEvent (LongPressEvent.hx:102:7)
    at Function.feathers_events_LongPressEvent.dispatchFromMouseEvent (LongPressEvent.hx:68:11)
    at feathers_utils_LongPress.longPress_target_enterFrameHandler (LongPress.hx:274:4)
    at feathers_controls_Button.__dispatchEvent (EventDispatcher.hx:402:5)
    at feathers_controls_Button.__dispatch (DisplayObject.hx:1399:17)
    at openfl_display_Stage.__broadcastEvent (Stage.hx:1166:6)
    at openfl_display_Stage.__onLimeRender (Stage.hx:1950:3)
    at lime_app__$Event_$lime_$graphics_$RenderContext_$Void.dispatch (EventMacro.hx:91:17)
    at lime__$internal_backend_html5_HTML5Application.handleApplicationEvent (HTML5Application.hx:373:33)

after checking code found this there:

if (event.type != MouseEvent.MOUSE_DOWN) {
    throw new ArgumentError("LongPressEvent.fromMouseEvent() requires MouseEvent.MOUSE_DOWN");
}

testing on HTML5 target

doing something wrong here ?

thank you

joshtynjala commented 2 years ago

Thanks!