Keypress events and blur the issue of conflict

Demand: Demand Click: Click the Add tab out input box, you can submit implementation of the results tab when you click enter key and blur the contents of the input is complete, the content determine the time of submission, after the execution is completed clear the contents in the input. As shown below

Question: After the completion of the blur event execution contents of the input is no problem, but will first execute keypress keypress and then execute blur when, after performing due to a previous event input box, the execution will inform the user when the blur is not input, resulting in very poor experience. 
Solution: Well, I write to you I found out I was wrong, because will always execute blur function, I just write directly to a blur event like ah, ah ah ah, painful, like so many simple as that.
Other: But if the content keypress and blur to be executed is not the same, you can add a timer to solve this problem

Guess you like

Origin www.cnblogs.com/tiger4513/p/11555029.html