javascript - HTML and JS on Windows only - input field does not generate onkeup/down events for non-english chars
问题描述
I have a very simple code with a text input box and a simple onkeyup handler. For some reason if my keyboard is in non-English language ( Russian, for example ) - they chars will be shown in the input field but no events will be generated. Pressing speace,enter or even arrows will generate the event and then the whole text is visible to the code.
This behavior is only like that on Windows ( IE, chrome, Edge ). On MAC it works as expected ( Chrome, Safari )
function line_Change(obj)
{
alert("here");
}
<input type="text" id="input1" onkeyup = "line_Change(this)" placeholder="Try typing something in here!">
<label for="input1">Line 1</label>
EDIT: I found out that it does not work when connected to Windows from macOS thru TeamViewer. When working directly on Windows - the results are as expected
解决方案
推荐阅读
- powershell - 具有运行空间而不是 foreach 循环的多线程
- github - 如何一次更新多个提交的状态
- c# - 如何从测试项目中读取 API 项目的启动设置?
- winapi - SspiPromptForCredentials 目标名称
- javascript - Three.js 360 图像 - 纹理标记为更新,但图像不完整
- javascript - 阿拉伯语脚本在 Google 的开发者工具模拟器上呈现不正确
- android - 有没有办法为按钮创建 android:text 状态选择器?
- java - cucumber.runtime.CucumberException:初始化浏览器时添加cookie时无法实例化类stepDefinitions
- python - 如何重新启动女服务员?
- php - 使内爆语句按我需要的方式工作