Stopping interaction will throw errors
See original GitHub issueFirst, thank you for an amazing library!
I have a situation where I need to stop interaction in the onstart
-event due to a competing gesture that has to lock down all other touch events in the app.
Even though it has the desired effect, calling interaction.stop()
in the Draggable’s onstart
-event throws errors, which are currently filling the error logs of my app.
...
onstart: function(event) {
event.interaction.stop();
},
...
Reproduction: https://jsfiddle.net/a8j9bta5/
Is this the appropriate way to stop the interaction? I couldn’t find anything else in the API for the task.
Expected behavior
Nothing should happen.
Actual behavior
Dragging doesn’t start (as it should), but erros get thrown. Seems that depending on browsers or other external variables the error thrown is a bit different.
Uncaught TypeError: Cannot read property 'options' of null
at Ma (interact.min.js:9)
at xa.setModifications (interact.min.js:52)
at xa.pointerMove (interact.min.js:61)
at HTMLDocument.<anonymous> (interact.min.js:16)
System configuration
interact.js version: v1.2.8 Browser name and version: Chrome 56.0.2924.87, Safari 10.0, basically all browsers Operating System: Os X 10.11.6, Android 5, iOS 10 …
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
@nikparo from
v1.3.0-alpha.0
onwards, actions are started by default only with the left mouse button (54ebdc3).@arggh sorry, I overlooked where the error was actually happening. I’m working on it now.
Can’t remember where I got it from or whether it’s documented or not, but I’m calling
interact.stop()
from adragstart
handler and it has been working just fine.