IE 10/11中的ComboBox成为焦点 [英] ComboBox in IE 10/11 be focus

查看:132
本文介绍了IE 10/11中的ComboBox成为焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ext版本:5.1.0.107
浏览器:IE 10/11

Ext version: 5.1.0.107 Browser: IE 10/11

当我创建一个带有值的ComboBox时,ComboBox将在它之后关注渲染。

While i create a ComboBox with a value, the ComboBox will be focus after it was rendered.

demo: http://ift.tt/1326fZR

我如何解决这个问题?

推荐答案

在我覆盖了更多内容之后,它才有效。

For me it worked after I have override something more.

Ext.override(Ext.form.field.Base, {
    initEvents: function() {
        var me = this,
        inputEl = me.inputEl,
            onFieldMutation = me.onFieldMutation,
            events = me.checkChangeEvents,
            len = events.length,
            i, event;
        if (inputEl) {
            me.mon(inputEl, Ext.supports.SpecialKeyDownRepeat ? 'keydown' : 'keypress', me.fireKey, me);
            for (i = 0; i < len; ++i) {
                event = events[i];
                if (event === 'propertychange') {
                    me.usesPropertychange = true;
                }
                if (event === 'textInput') {
                    me.usesTextInput = true;
                }
                me.mon(inputEl, event, onFieldMutation, me);
            }
        }
        me.callParent();
    },

    bindPropertyChange: function(active) {
        var method = active ? 'resumeEvent' : 'suspendEvent',
            inputEl = this.inputEl;
        if (this.usesPropertychange) {
            inputEl[method]('propertychange');
        }
        if (this.usesTextInput) {
            inputEl[method]('textInput');
        }
    }
});

这部分是从版本5.1.1.451复制的,其中bug已经修复。

This part is copied from version 5.1.1.451 where bug is already fixed.

这篇关于IE 10/11中的ComboBox成为焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆