相关疑难解决方法(0)

keypress 和 keydown 优先于 Firefox 和 Safari 中的粘贴事件

我有一个使用 jqlite 的 Angular 指令,我想绑定一个按键、按键和粘贴事件来更新指令上的选项。

我使用以下方法绑定到 paste、keypress 和 keydown 事件:

input.bind("paste.elementClass", updateOptions);
input.bind("keypress.elementClass", updateOptions);
// keypress does not fire if the backspace/delete button is pressed. This keydown listener triggers the
// keypress event if backspace/delete is pressed. Didn't use keydown listener instead of keypress because
// keydown did not register if multiple buttons are pressed (shift + d). The keyup event choked
// if a button was pressed and held for longer than the model debounce time.
input.bind("keydown.elementClass", function() { …
Run Code Online (Sandbox Code Playgroud)

javascript jquery angularjs

5
推荐指数
1
解决办法
4599
查看次数

标签 统计

angularjs ×1

javascript ×1

jquery ×1