kendo-ui-core
kendo-ui-core copied to clipboard
The client-side enable method does not enable a disabled ContextMenu item
Bug report
When using the Telerik UI for ASP.NET Core ContextMenu wrapper and an item is initialized as disabled, calling the client side enable method does not enable the item.
Reproduction of the problem
- Initialize a disabled item:
items.Add()
.Text("Reply")
.ImageUrl(Url.Content("~/shared/web/toolbar/reply.png"))
.HtmlAttributes(new { id = "ReplyID", title = "Reply" })
.Enabled(false)
.Items(children =>
{
children.Add().Text("Reply To Sender").ImageUrl(Url.Content("~/shared/web/toolbar/reply.png"));
children.Add().Text("Reply To All").ImageUrl(Url.Content("~/shared/web/toolbar/reply.png"));
});
- Call the enable method:
var menu = $("#menu").data("kendoContextMenu");
menu.enable("#ReplyID", true);
Current behavior
The ContextMenu item is not enabled
Expected/desired behavior
The ContextMenu item is enabled
Workaround
Remove the k-state-disabled class from the element with id ReplyID
$("#ReplyID").removeClass("k-state-disabled")
Environment
- Kendo UI version: 2022.2.621
- Browser: [all]
Will be fixed with https://github.com/telerik/kendo/pull/15381
The issue is fixed with 2022.3.913