Immediately read input on "input" event

To prevent race conditions where an API call triggers a
resetInput before the new input has been read.

Closes #2975