Reputation: 21
I'm using the latest Kendo UI version with jQuery version 1.8.
Everything works well except filtering in Kendo dropdownlists. When the filter is enabled, the dropdown is closed immediately after opening. Please see the fiddle here: http://jsfiddle.net/EaNm4/389/
HTML
<input id="dropdownlist" />
JavaScript
$('#dropdownlist').kendoDropDownList({
optionLabel: 'Select option...',
dataTextField: 'text',
dataValueField: 'value',
dataSource: data,
filter: "contains"
});
When I changed the jQuery to a higher version (>= 1.9), the problem was resolved. However for some reasons I can't upgrade jQuery version at the moment. Does anyone know a "HACK" to fix this problem without changing jQuery version? Thank you.
Upvotes: 2
Views: 3132
Reputation: 95
You might try this:
$("[data-role=dropdownlist]").each(function () {
var widget = $(this).data("kendoDropDownList");
widget.wrapper.on("keydown", function (e) {
e.stopImmediatePropagation();
});
});
This is not my code, and unfortunately I cannot find the source, but as I understand it, the wrapper allows you to define some options not natively supported by the drop down list, like a keylistener, and "e.stopImmediatePropagation" in this case works similarly to "e.preventDefault", but only for the up-and-down action. My issue was similar to yours, and this resolved it.
Upvotes: 1
Reputation: 1500
That is only because od JS you can Change the JS Code as of now it contains aria-expanded="false"
but you have to Change like aria-expanded="true"
. then it will work fine .it Defind Under :class="k-widget k-dropdown k-header"
.
Click F12 and Check Console
By Default it takes aria-expanded="false"
but when i change it to aria-expanded="true"
it works fine better see snapshot
Upvotes: 0