开发者

firefox »find as you type« is conflicting with JavaScript key events

Firefox has »find as you type« functionality, which is super awesome. But when developing JavaScript web applications and I want to react on key events only the first key is capt开发者_高级运维ured, subsequent keys all go to the find field.

Is there a way to disable this with vanilla JS? (no frameworks such as MooTools)

I tried return false; at the end of the event handler, but it does not work.


Have you tried the preventDefault() method on the event object?

Also try to see the difference between binding to keyup/keydown/keypress (or maybe all of them) and see if there is a difference in controlling the events that way

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜