Added a method for programmatically dismissing the keyboard with animation (same behavior as when keyboard recedes after dragging).