[DE] Add focus manager.

[Combobox] Fix focus when no items are selected
This commit is contained in:
Julia Radzhabova 2020-09-27 13:48:21 +03:00
parent e59e7c09c9
commit 296d270348
2 changed files with 10 additions and 3 deletions

View file

@ -321,6 +321,9 @@ define([
$list.scrollTop(height);
}
setTimeout(function(){$selected.find('a').focus();}, 1);
} else {
var me = this;
setTimeout(function(){me.cmpEl.find('ul li:first a').focus();}, 1);
}
if (this.scroller)

View file

@ -48,7 +48,8 @@ define([
height: 196,
style: 'min-width: 230px;',
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
buttons: ['ok', 'cancel'],
focusManager: true
},
initialize : function(options) {
@ -103,11 +104,14 @@ define([
style : 'width: 100%;',
menuStyle : 'width: 100%; max-height: 210px;',
editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr',
data : this.options.formats,
disabled : (this.options.formats.length==0)
});
this.cmbNextStyle.setValue(-1);
this.focusManager.add([this.inputTitle, this.cmbNextStyle], '.form-control');
},
show: function() {
@ -115,7 +119,7 @@ define([
var me = this;
_.delay(function(){
me.inputTitle.cmpEl.find('input').focus();
me.inputTitle.focus();
},500);
},
@ -143,7 +147,7 @@ define([
if (state == 'ok') {
var checkurl = this.inputTitle.checkValidate();
if (checkurl !== true) {
this.inputTitle.cmpEl.find('input').focus();
this.inputTitle.focus();
return;
}
}