箭头键在输入和文本区域中不起作用 [英] Arrow keys not working in input and textarea
问题描述
我有一个简单的textarea和输入在我的web应用程序。由于某些原因,我不能回到键入的文本用箭头键。输入光标不向后移动。
但是我可以使用ctrl + a,或者单击鼠标在我要编辑的位置。这是混乱。我没有在我的代码中的任何键事件中使用e.preventDefault - 有大约30个js文件和一些巨大的css文件。
任何想法为什么箭头可能不工作?
谢谢!
JS文件,并寻找类似的东西:
keyCode == 37
pre>
或
which == 37
,因为这是向左箭头。可能某处有类似的东西:
if(e.keyCode == 37)
e.preventDefault ;
I have a simple textarea and input in my webapplication. For some reason, I cannot go back in the typed text with the arrow keys. The input cursor does not move backwards.
I can however use ctrl+a, or click the with the mouse on the position that I want to edit. This is confusing. I am not using e.preventDefault in any key event in my code - having around 30 js files and some huge css files -.
Any ideas on why the arrows might not work?
Thanks!
解决方案Do a search in all your JS files and look for something similar to:
keyCode == 37
or
which == 37
as this is the left-arrow. Probably somewhere there is something similar to:
if (e.keyCode == 37) e.preventDefault();
这篇关于箭头键在输入和文本区域中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!