KineticJS icon indicating copy to clipboard operation
KineticJS copied to clipboard

Touch event hit testing & compatability

Open bkatiemills opened this issue 11 years ago • 2 comments

Hi Kinetic,

I love your product! But recently, I was using it with x-tag, and ran into problems due to how kinetic is detecting touch events during hit testing - see this issue over at x-tag for some discussion from them. The problem can be seen at this line in kinetic, where you check if evt.touches !== undefined; this works fine with stand-alone kinetic, but breaks with x-tag since x-tag assigns evt.touches = [], an empty array and not undefined for non-touch events.

Could an application of instanceof as recommended by @csuwildcat help kinetic have less conflicts here?

bkatiemills avatar Apr 07 '14 06:04 bkatiemills

But TouchEvent is not defined in some browsers. http://caniuse.com/touch

lavrton avatar Apr 09 '14 13:04 lavrton

@lavrton that's the whole point: if you check for the instance instead of duck-typing, you can avoid conflicts.

csuwildcat avatar Jun 14 '14 16:06 csuwildcat