如何在textarea上检测箭头键的按键事件?(How to detect key down event for arrow key on textarea?)

创建以下html页面:

<textarea id="code" rows="10"></textarea> <script> document.onkeydown = function(event) { alert(event.keyCode); } </script>

移动Safari上打开它(在模拟器或键盘上的设备上),点击textarea开始编辑。 现在按任意箭头键 - 事件不会触发。

如何检测箭头键的按键?

关于Apple Bug报告系统的PS相关问题:13243285

Create the following html-page:

<textarea id="code" rows="10"></textarea> <script> document.onkeydown = function(event) { alert(event.keyCode); } </script>

Open it on Mobile Safari (on a simulator or on a device with keyboard), tap on textarea to start editing. And now press any arrow key - event won't fire.

How to detect key down for arrow keys?

P.S. Related issue on Apple Bug Report system: 13243285

最满意答案

苹果公司的正式答复:

感谢您与Apple Developer技术支持(DTS)联系。 我们的工程师已审核您的请求,并得出结论认为,鉴于目前的运输系统配置,没有支持的方式来实现所需的功能。

Official answer from Apple:

Thank you for contacting Apple Developer Technical Support (DTS). Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations.

更多推荐