Completed
Last Updated: 29 Jun 2026 14:59 by ADMIN
Release 2026 Q2 SP1
CaseNet
Created on: 20 Jan 2021 13:26
Category: Menu
Type: Bug Report
1
JavaScript error (Uncaught TypeError: Cannot read property 'keyCode' of undefined) is thrown when selecting an autocomplete suggestion in Chromium browsers

Reproduction - http://somup.com/crVYIDot19

Setup to reproduce:

<telerik:RadContextMenu ID="RadContextMenu1" runat="server">
    <Targets>
        <telerik:ContextMenuDocumentTarget />
    </Targets>
    <Items>
        <telerik:RadMenuItem Text="item">
            <ItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" />
            </ItemTemplate>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadContextMenu>

<telerik:RadButton runat="server" ID="RadButton2" Text="Postback" AutoPostBack="true" />

Steps to reproduce:

  • Show the context menu with a right mouse click on the document.
  • Type in a custom value in the TextBox embedded in the menu.
  • Perform a postback by clicking on the RadButton.
  • Show the context menu again. In the textbox, pick the autocomplete suggestion by the browser.
2 comments
ADMIN
Rumen
Posted on: 29 Jun 2026 14:59

Hi everyone,

I tested the reported issue in Chrome (Version 149.0.7827.197) using the latest official release — Telerik UI for ASP.NET AJAX 2026 Q2 (2026.2.519) — and was unable to reproduce it.

I'll go ahead and mark this case as resolved. That said, if you continue to experience the issue after upgrading to the latest version, please don't hesitate to reach out and we'll be happy to investigate further.

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
ADMIN
Doncho
Posted on: 20 Jan 2021 13:45

Hi,

Here is a temporary workaround for the issue:

Place the below JavaScript code on the page, after the ScriptManager (or RadScriptManager):

Telerik.Web.UI.RadContextMenu.prototype._onKeyDown = function (e) {

    if (!e.keyCode && !e.rawEvent) return;

    var item = this.get_focusedItem();
    var keyCode = e.keyCode ? e.keyCode : e.rawEvent.keyCode;
    var items = this.get_items();

    if ($(e.target).closest(".rmTemplate").length > 0) {
        return false;
    }

    if (keyCode === Sys.UI.Key.esc) {
        this._hide();
        return false;
    }

    if (!item) {
        switch (keyCode) {
            case Sys.UI.Key.up:
                var lastItem = items.getItem(items.get_count() - 1);

                if (lastItem.get_visible()) {
                    lastItem.focus(e);
                } else {
                    lastItem.focusPreviousItem(e);
                }
                break;

            case Sys.UI.Key.down:
                var firstItem = items.getItem(0);

                if (firstItem.get_visible()) {
                    firstItem.focus(e);
                } else {
                    firstItem.focusNextItem(e);
                }
                break;

            case Sys.UI.Key.enter:
                this._hide();
                break;
        }
        return false;
    }

    return this._keyboardNavigator._onKeyDown(e, item);
}
Kind regards,
Doncho
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/.