IE 10/11 中的 ComboBox 成为焦点
ComboBox in IE 10/11 be focus
分机版本:5.1.0.107
浏览器:IE 10/11
虽然我创建了一个带有值的 ComboBox,但 ComboBox 在渲染后将成为焦点。
demo: http://ift.tt/1326fZR
我该如何解决这个问题?
您可以在这里找到解决方案:
https://www.sencha.com/forum/showthread.php?296103-ComboBox-in-IE-10-11-be-focus
Ext.define('Ext.overrides.form.field.ComboBox', {
override: 'Ext.form.field.ComboBox',
// OVERRIDE
checkChangeEvents : Ext.isIE ?
['change', 'propertychange', 'keyup'] :
['change', 'input', 'textInput', 'keyup', 'dragdrop']
});
对我来说,它在我重写了更多内容后才起作用。
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已经修复
分机版本:5.1.0.107 浏览器:IE 10/11
虽然我创建了一个带有值的 ComboBox,但 ComboBox 在渲染后将成为焦点。
demo: http://ift.tt/1326fZR
我该如何解决这个问题?
您可以在这里找到解决方案:
https://www.sencha.com/forum/showthread.php?296103-ComboBox-in-IE-10-11-be-focus
Ext.define('Ext.overrides.form.field.ComboBox', {
override: 'Ext.form.field.ComboBox',
// OVERRIDE
checkChangeEvents : Ext.isIE ?
['change', 'propertychange', 'keyup'] :
['change', 'input', 'textInput', 'keyup', 'dragdrop']
});
对我来说,它在我重写了更多内容后才起作用。
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已经修复