Last Updated:
30 Aug 2024 07:13
by ADMIN
Hi Guys,
I have been investigating an issue with the ComboBox component under Chrome whereby a scrollbar is being show when using the autoWidth option and a limited number of list entries.
The scenario is as follows
- When the control initially loads and you hit the dropdown button the list does not have vertical scrollbar.
(See screen shot 1)
- Select an item and and then hit the clear button.
Now when you hit the dropdown the list has a vertical scrollbar.
(See screen shot 2)
The issue is very random and can occur with any number of list items, providing the initial dropdown doesn't require a scrollbar.
I have tried to create a dojo to illustrate the problem but have so far failed.
Looking at the element with Dev tools I see on the initial dropdown the wrapper div is as follows
<div class="k-list-content k-list-scroller" unselectable="on" style="overflow: hidden auto;">
but after select, clear & dropdown the div shows
<div class="k-list-content k-list-scroller" unselectable="on" style="overflow: hidden scroll;">
Tracing through the code the problem is within the following function of the kendo.list.js file
_refreshScroll: function() {
var listView = this.listView;
var enableYScroll = listView.element.height() > listView.content.height();
if (this.options.autoWidth) {
listView.content.css({
overflowX: "hidden",
overflowY: enableYScroll ? "scroll" : "auto"
});
}
},
It would appear that under certain conditions Chrome is setting the enableYScroll value to true and hence the 'scroll'.
Looking at this function I cannot see a reason why there is even a need to set overflowY to 'scroll' surely just leaving it set as 'auto' is good enough and let the browser decided if scrollbars are required.
Regards
Alan