修复handsontable自动完成不支持中文的bug

handsontable是一个功能强大的在线表格插件,可以实现类似于excel的功能,用于web表现非常不错,尤其是内部系统的表格处理更是锦上添花。


网址:http://handsontable.com/


目前最新的版本是0.12.2,但老外在开发时没有考虑到中文输入法的问题,出现了自动完成不能输入中文的bug,下面是修复的办法。修复后在firefox,chrome和IE11上测试通过。


修复步骤:


1.3936行中的"keydown"改为"keyup",结果如下:

1
2
3
       eventManager.addEventListener(document,  'keyup' function  (ev){
         instance.runHooks( 'afterDocumentKeyDown' , ev);
       });


2.注释掉1199,1202行,结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
   /**
    * Listen to document body keyboard input
    */
   this .listen =  function  () {
     Handsontable.activeGuid = instance.guid;
 
     if  (document.activeElement && document.activeElement !== document.body) {
       //document.activeElement.blur();
     }
     else  if  (!document.activeElement) {  //IE
       //document.body.focus();
     }
   };










本文转自 ustb80 51CTO博客,原文链接:http://blog.51cto.com/ustb80/1596319,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值