admin管理员组文章数量:1315025
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 e up.
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 e up.
Share Improve this question edited Oct 26, 2018 at 11:58 evgeni fotia 4,8103 gold badges18 silver badges36 bronze badges asked Oct 26, 2018 at 10:40 watthecodewatthecode 1012 silver badges7 bronze badges 1- 1 How are the user supposed to write if you, for instance, hide the keyboard ? You might force a blur as the answer below suggested, but this is extremely dirty from the UX perspective. – Cristian S. Commented Oct 26, 2018 at 10:48
1 Answer
Reset to default 9e.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();
}
}
本文标签: javascriptIn Regular React how to dismiss mobile keyboards on submit or 39enter39 keyStack Overflow
版权声明:本文标题:javascript - In Regular React how to dismiss mobile keyboards on submit or 'enter' key? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741973094a2407957.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论