Prevent JS error when removing the focused input field from a view.