Skip to content

Conversation

@MIfoodie
Copy link
Contributor

-Added the inputmode of "email" to tell mobile browsers to change to the email keyboard for username/email input

-Added the inputmode of "numeric" to tell mobile browsers to change to the numeric keyboard for 2fa input (https://www.w3schools.com/TAgs/att_inputmode.asp)

-Changed two-factor code input type to "numeric" to provide a greater hint to autofill that this is where they should fill in 2fa codes

This is my first PR in this repo so let me know if I did something horribly wrong or taboo :)

-Added the inputmode of "email" to tell mobile browsers to change to the email keyboard for username/email input

-Added the inputmode of "numeric" to tell mobile browsers to change to the numeric keyboard for 2fa input (https://www.w3schools.com/TAgs/att_inputmode.asp)

-Changed two-factor code input type to "numeric" to provide a greater hint to autofill that this is where they should fill in 2fa codes

Signed-off-by: MIfoodie <94649676+MIfoodie@users.noreply.github.com>
Removed extra whitespace before the Google authentication link.

Signed-off-by: MIfoodie <94649676+MIfoodie@users.noreply.github.com>
@MIfoodie MIfoodie changed the title Change input mode and types and for sign-in form Change input mode and types for sign-in form Dec 30, 2025
@IMB11
Copy link
Member

IMB11 commented Dec 30, 2025

The inputmode additions are good!

However, changing from type="text" to type="number" for the 2fa input changes the way the value is parsed when a authenticator app or autofill extension pastes into the field;

  • A code like 012345 becomes 12345, breaking validation
  • Users can enter ., -, e (scientific notation) depending on browser/mobile keyboard being used (gboard allows this)
  • Spinner controls will appear (not entirely sure if you have disabled these?) - the increment/decrement arrows are useless and add visual noise
  • Breaks the maxlength attribute, maxlength doesn't work on type="number"

I would recommend you revert the type changes, and keep the inputmode ones - MDN is also a bit more authoritative than w3 asw for future reference :) https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete

@IMB11 IMB11 self-requested a review December 30, 2025 20:54
Signed-off-by: MIfoodie <94649676+MIfoodie@users.noreply.github.com>
@MIfoodie
Copy link
Contributor Author

@IMB11 Thank you for the review! 169e502 should fix it. I didn't realize that the number type did more than just make the box only accept numbers.

@MIfoodie MIfoodie changed the title Change input mode and types for sign-in form Change input mode for sign-in form Dec 30, 2025
@Prospector Prospector enabled auto-merge December 31, 2025 17:47
@Prospector Prospector added this pull request to the merge queue Dec 31, 2025
Merged via the queue into modrinth:main with commit b7e7e5e Dec 31, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants