Events triggered on an input element sometimes did not trigger