Reputation: 101
I am trying to find this answer, but all the other questions I have found are React Native.
`handleEnter(e){
if(e.key == 'Enter'){
//REMOVE KEYBOARD
}
}`
Also my input is a text search. So I want the keyboard to hide so users can see the results that come up.
Upvotes: 3
Views: 5527
Reputation: 4810
e.target
is the focused input
or textarea
where the user is writhing. When he click on Enter
the focused input
became unfocused and so the keyboard disappear
handleEnter(e){
if(e.key == 'Enter'){
e.target.blur();
}
}
Upvotes: 9