javascript - 使用 Mousetrap.js 聚焦输入字段-但输入字段也将热键粘贴为值?
问题描述
解决方案
have you tried event.preventDefault() ?
Mousetrap.bind("alt+1", (e) => {
e.preventDefault();
this.focusTextInput(1);
})
Mousetrap.bind("alt+2", () => {
e.preventDefault();
this.focusTextInput(2)
})
推荐阅读
- python - ImportError:无法从“django.http”导入名称“HttpResponce”
- python - Python 电子邮件:尝试获取 HREF 链接值时,该值不使用等号 (=) 保存
- python - 抑制 Paramiko 标准错误输出
- node.js - 静态路径 Express + Nginx
- android - 浓缩咖啡验证文本是否不存在不起作用
- php - $a++ + $a++ + $a vs $a + $a++ + $a++ 的执行方式
- python - 如何停止windows启动python脚本
- vba - 在单独的子程序中使用子程序的输出作为变量
- c++ - “未定义对‘WinMain@16’的引用”gcc 编辑器中的错误
- python - IMAP 如何保存**所有**附件