onkeyup event in Safari on IOS7 from a bluetooth keyboard

心已入冬 提交于 2019-11-29 14:16:12

Seems that "onkeypress" works as expected though.

Since this was a problem a bumbed in to in a Sencha Touch project and Sencha Touch doesn't have a keypress event on textfields I'm posting the code that solved my problem.

{
    xtype:'searchfield',
    name:'search',
    placeHolder:'search',
    listeners: {
        painted: {
            fn: function () {
                var me = this;
                me.element.dom.onkeypress = function (e) {
                    if (e.keyCode === 13) {
                        me.fireEvent('searchkeypress', me, e);
                    }
                };
            }
        }
    }
}

I faced a similar problem @EmilPennlov. I was able to solve this by using a $watch on the input field. Worked like a charm.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!