Fixed a JS error when auto-scrolling during a drag