Added timeoutID and clearTimeout for caret

Added timeoutID and clearTimeout for moveCaret