yoannmoinet / nipplejs

:video_game: A virtual joystick for touch capable interfaces.
https://yoannmoinet.github.io/nipplejs
MIT License
1.77k stars 181 forks source link

[BUG] dataOnly will create an exception in move event creation #201

Open MarcMenghin opened 1 year ago

MarcMenghin commented 1 year ago

Describe the bug Errors are thrown from move event when dataOnly is set to true.

To Reproduce sample code: https://gist.github.com/MarcMenghin/a20f59370d66f30a97510f30b0fd4c2f

Expected behavior move events are fired just like if dataOnly is set to false.

Desktop (please complete the following information):

Additional context

Uncaught TypeError: o.el is undefined
    processOnMove https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    p https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    processOnStart https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    onstart https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    v https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    onstart https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    i https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    p https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    bindEvt https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    bindings https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    E https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    createCollection https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    create https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    create https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.0/nipplejs.js:1
    <anonymous> file:///C:/Users/marcm/Development/engel/samples/nipplejs/index.html:53
nipplejs.js:1:14702
MarcMenghin commented 1 year ago

My current workaround is to forcefully hide the generated UI with CSS.