I'm working on a cross-browser compatibility issue with HTML input fields.
On my Chrome 63.0, when I pressed enter in an input[type=text], it triggers change
event, and no blur
event is fired. ( I tired with this https://jsfiddle.net/agentmilindu/ekhT4/2984/ )
However, I see in some browsers, a blur
event is triggered when pressing enter.
I see lot of question on StackOverflow asking how to stop triggering this blur
event when enter is pressed,
- Prevent both blur and keyup events to fire after pressing enter in a textbox
- onkeypress + onblur in javascript
The app( a PhoneGap app written in React ) I'm currently investigating has a function which gets triggered by blur
event when the user press enter, but in new browsers ( new phones and on my Chrom 63.0 also ) this is not working.
Now I'm confused what is the actual default behaviour when someone press enter in an input[type=text] filed. Should it be change
+blur
or only change
? Is there any document which I can refer?