Blazor context menu misaligned when scrolled down in page.

I have a blazor data grid with the built in context menu, and I also have a button in one of the rows that targets a context menu on click.  Both Context Menus open fine when I am at the top of the page, but when I scroll down on the page the context menu gets to be misaligned.


Code that runs when I click the button to open the context menu:


 public SfContextMenu<MenuItem> ContextMenuFromButton;

public async Task ContextMenuOpenFromButton(MouseEventArgs e, Guid id)

        {

            await ContextMenuOpenHandler(id);

            ContextMenuFromButton.Open(e.ClientX, e.ClientY);

        }


How do I keep proper alignment of context menu everywhere on the page?

See attached vide



Attachment: BlazorContextMenuMisaligned_84ffaa5f.zip

3 Replies

AS Aravinthan Seetharaman Syncfusion Team August 31, 2021 04:56 PM UTC

Hi Zachary, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query. We need to validate more on this and need to ensure more cases regarding this query. So, we will update further details on 2nd September 2021. We appreciate your patience until then. 
 
Regards, 
Aravinthan S 



ZW Zachary Witt September 3, 2021 02:14 PM UTC

Is there any update on this? I had to downgrade to version 19.1.0.69 to get this to work right.



GK Gayathri KarunaiAnandam Syncfusion Team September 6, 2021 10:07 AM UTC

Hi Zachary, 

Thanks for the patience. 

We have validated your reported query. We are unable to replicate reported issue in our end. We have prepared a sample and video demonstration. Please check the below code. 

Code: 

<GridColumns> 
        <GridColumn Field=@nameof(OrdersDetails.EmployeeID) HeaderText="Employee Id" IsPrimaryKey="true" TextAlign="@TextAlign.Center" HeaderTextAlign="@TextAlign.Center" Width="140"></GridColumn> 
        <GridColumn Field=@nameof(OrdersDetails.Name) HeaderText="Name" Width="150"> 
    <Template> 
                @{ 
                       <div id="target"> 
    <SfContextMenu @ref="contextMenuObj" TValue="MenuItem"> 
        <MenuItems> 
            <MenuItem Text="Cut"></MenuItem> 
            <MenuItem Text="Copy"></MenuItem> 
            <MenuItem Text="Paste"></MenuItem> 
        </MenuItems> 
    </SfContextMenu> 
    <SfButton OnClick="OpenContextMenu">Open ContextMenu</SfButton> 
</div> 
                } 
            </Template></GridColumn> 
 
SfContextMenu<MenuItem> contextMenuObj; 
    private void OpenContextMenu(MouseEventArgs e) 
    { 
        contextMenuObj.Open(e.ClientX, e.ClientY); 
    } 

For your reference, we have prepared a sample based on this. Please check the below sample. 



Please kindly update to latest version(19.2.59) and If you are still facing issue, share the below details. 

  • If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample.
  • Please share context menu related code snippet.
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 

Regards, 
Gayathri K 



Loader.
Up arrow icon