Invalid element is not focused when validate a custom set of inputs

Invalid element is not focused when validate a custom set of inputs and the last one is a valid input.