kendo-ui-core icon indicating copy to clipboard operation
kendo-ui-core copied to clipboard

The client-side enable method does not enable a disabled ContextMenu item

Open aleksandarevangelatov opened this issue 3 years ago • 1 comments

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

  1. 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"));
  });
  1. Call the enable method:
var menu = $("#menu").data("kendoContextMenu");
menu.enable("#ReplyID", true);

Example

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]

aleksandarevangelatov avatar Jun 29 '22 07:06 aleksandarevangelatov

Will be fixed with https://github.com/telerik/kendo/pull/15381

aleksandarevangelatov avatar Jun 29 '22 07:06 aleksandarevangelatov

The issue is fixed with 2022.3.913

Dimitar-Goshev avatar Sep 30 '22 10:09 Dimitar-Goshev