Making-of: draggable objects #

I noticed last year that some of my projects behave inconsistently on touch devices. I didn't do anything about it. But then I was working on a tutorial about how I make my interactive tutorials, I had to show how to handle touch events, and I was embarassed by my code. I decided to take a week to learn about mouse, touch, and pointer events.

That week turned into two. And three. And eight.

I learned a lot. Not only about the event handling spec, but also differences in browser behavior and operating system behavior.

State diagram for mouse and touch events

I was able to greatly simplify my code by using newer APIs and by removing unnecessary code.