Unplanned
Last Updated: 12 Oct 2026 14:34 by AMF
AMF
Created on: 12 Oct 2026 14:34
Category: ContextMenu
Type: Bug Report
0
Page scrolls up on first ContextMenu opening

The ContextMenu components triggers a page scroll up on first opening. The problem may be specific to WebAssembly apps. Here is a test page with an applied workaround:

https://blazorrepl.telerik.com/wglavwvy31XgaQIJ18

The important code in the above example is:

<TelerikContextMenu @ref="@ContextMenuRef" />

@code {
    private TelerikContextMenu<ContextMenuItem> ContextMenuRef { get; set; }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender && ContextMenuRef is not null)
        {
            await Task.Delay(1);
            await ContextMenuRef.ShowAsync(1, 1);
            await ContextMenuRef.HideAsync();
        }
    }
}

 

0 comments