JavaScript code not behaving as expected

Problem description:
My code/script behaves

using the web-app via my laptop,
I run into no problems, zero. But when using my mobile phone, I get issues >> like; auto enter + char. accumulation.
[?] I wanted to show off my progress (course-ware) to a colleague.

JavaScript: final project

Expected behavior:
question is prompt;
input answer + enter,
after aswers is given, the next question follows.
when wrong answers is given, user is prompted to, answer again.

Actual behavior:

when using node.js-replit on mobile;
something strange happens, when question; your gender type, is answered
falsely. >> an auto enter follows + any key stroke, gets printed. ; this behaviour repeats when done multible times over, adding more characters to the screen.

Steps to reproduce:
step through; while answering the questions, [name, surname, age, ]

##until;

“Please enter your gender; M for male, F for female, or X for binary”

now input a wrong answer.

##again when;

“Your preference type; M for male, F for female, or X for binary”

now input a wrong answer.

Bug appears at this link:
[node.js]
levivangenderen/
JavaScript: final project

https://replit.com/@levivangenderen/JavaScript-final-project

Browser/OS/Device:

Replit-App/Samsung Internet, Android 13, Samsung A53

You might want to look into a do…while loop. for code conciseness. Apart from this, the issue doesn’t seem to happen to me. What wrong answer are you putting?

1 Like

You’ve tested on mobile? It works fine for me on a laptop, but OP said that it only happens on mobile

You’ve tested on mobile?

Yes, on an iPad with the replit app