We are using a Kendo comboBox control, which behaves correctly if an option is selected by opening the dropdown list and clicking the option. However, the following behavior is observed when selecting an option by typing in the dropdown box:
-Start typing: a small list of corresponding options appears
-Select one of the options in the list: the seleted option appears in the dropdown box. So far the behavior is correct.
-Click the caret of the dropdown to expand the list of options.This has the result that the selected option changes to the last option of the dropdown list, and all the options are highlighted as if selected. Inspecting the HTML elements shows they all have class k-item and k-state-selected.
What is causing this behavior? Shouldn't only one item at a time have the class k-state-selected? Is there some option that has to be set? I would be thankful for any help on this.
We are using Kendo UI v2016.1.322, Internet Explorer 11.0.9600.18314, Windows Server 2008 R2 Enterprise.
The HTML uses this directive as shown:
<sc-combo-box type="availYear" sc-filters="AvailYear" placeholder="Select Avail Year" default-value="'2016'"></sc-combo-box>
The comboBox control is built in the directive as follows:
var controller = function ($scope, $attrs, data) {
var vm = this;
vm.cbUUID = '';
vm.type = '';
vm.defaultValue = $scope.$parent.$eval($attrs['defaultValue']);.
:
:.
vm.render = function (element, placeholder, type, scFilters) {
vm.cbUUID = helper.guid().toString();
vm.filterNames = scFilters.toString();
vm.filterNames = scFilters.toString();
// establish new id for combobox
element.attr('id', vm.cbUUID);
// create datasource, establish options used when creating combobox and combine into one 'options' object
var options = helper.concatObjects(vm.buildDataSource(vm.filterNames), {
placeholder: placeholder,
value: vm.defaultValue,
filter: 'contains'
});
// established combobox options
element.kendoComboBox(options);
};
};
var directive = {
link: link,
require: 'scComboBox',
restrict: 'E',
replace: true,
scope: {
defaultValue: '='
},
controller: ['$scope', '$attrs', 'data', controller],
template: '<select id="scComboBox" style="width: 100%"></select>'
};
return directive;
function link($scope, $element, $attrs, ctrls) {
ctrls.render($element, $attrs.placeholder, $attrs.type, $attrs.scFilters);
}
}