If you enter the same content twice in a row in the same input box, an error will occur

If you enter the same content twice in a row in the same input box, an error will occur,Is there a way to improve

can you send error?

NO ERROR
I have appeared many times. If there is content in the input box, this phenomenon will occur if you use the type command to input the same content again, that is, the input box will be one less. The current circumvention method I use is to clear the input box before typing