Bug: normalizeTouchPosition null pointer
blaues0cke opened this issue · 3 comments
blaues0cke commented
For some reasons, on touch devices sometimes normalizeTouchPosition
gets called while event.targetTouches
contains zero items. This will make this code to fail since the first item (targetTouches[0]
) does not exist:
const position = {
clientX: ('targetTouches' in event) ? event.targetTouches[0].pageX : event.clientX,
clientY: ('targetTouches' in event) ? event.targetTouches[0].pageY : event.clientY
};
The error then is
undefined is not an object (evaluating 'event.targetTouches[0].pageX')
woutervh- commented
Hi @blaues0cke
Very strange indeed, since under normal circumstances the normalizeTouchPosition
should not be called when there are no pointers in the event. I will investigate this and put in extra safety measures to prevent the error from happening.
Thanks!
woutervh- commented
Fixed in version 2.1.5
blaues0cke commented
Thank you very much (appeared on an iPad pro running iOS 12). :-)