This is  happening because the key pressed is not a number or backspace and we don't yet have a full pin so it makes sense in the this context (though I can see a comment would be useful because as a condition it looks wrong at first glance.)

The too short case shouldn't ever happen because submits aren't enabled until the pin is 4 chars but that would only occur if submit happened on the form.