I'm having resize issues with the Menu control that I cannot sufficiently document at this time (my menu is inside a splitter, it's horizontal and it should be scrollable, but the arrows don't always appear).
I tried working around them by manually forcing a resize. Per documentation:
Each Kendo UI widget has a resize()
method which can be used to trigger a layout readjustment instead of using kendo.resize
. The resize
method of the widget accepts a single Boolean parameter, which defines whether the control should execute its layout adjustment algorithm even if the widget dimensions have not changed ("force"
mode).
However, the Menu widget does not override this method. It only binds to the Window resize event:
$(window).on(RESIZE, kendo.throttle(function(){
that._setOverflowWrapperWidth(initialWidth, initialCssWidth);
that._toggleScrollButtons(that.element, backwardBtn, forwardBtn, isHorizontal);
}, 100));
It's highly probable that the magic value 100 does not fit my use case. However, I cannot force a resize neither by:
Possibly related to https://github.com/telerik/kendo-ui-core/issues/4067 .
Hello Anna,
Thank you for reporting this. I have also logged an item in our GitHub repository where you can monitor the status of the item:
https://github.com/telerik/kendo-ui-core/issues/6247
As the scroll is added as a wrapper to the Menu element, until the issue is resolved, I can suggest is trying to set the width of the element and also the witdth of its parent:
$(document).ready(function() {
$("#example").width(400);
const menu = $("#horizontalMenu").kendoMenu({
scrollable: true
}).data("kendoMenu");
//$("#example").width(200);
menu.element.width(200);
menu.element.parent().width(200);
});
Here is a modified example of the one you have provided. I hope the suggestion above would suit your scenario until the issue is resolved.
I have also updated your Telerik points.
Regards,
Aleksandar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.