如何限制GWT中的Tab键处理程序事件 [英] How to restrict tab key handler event in gwt
本文介绍了如何限制GWT中的Tab键处理程序事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将GWT组件用于网页.在我的页面中,我使用了十个文本框.我想阻止选项卡"键事件,以将一个文本框导航到另一个文本框.
I am using GWT components for web page. In my page I used ten text boxes. I want to block "tab" key event for navigate one text box to another text box.
预期的方法:如果按Tab键,则不会转到另一个文本框.
Expected Approach: If I pressed tab key it wont go to another text box.
推荐答案
Use NativePreviewEventHandler and use the logic mentioned by Mayank Pandya, which is
if (event.keyCode == 9) {
event.preventDefault();
}
检查Tabkey
密钥代码.我不确定.
Check for the Tabkey
keycode. I am not sure about it.
这篇关于如何限制GWT中的Tab键处理程序事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文