Context menu doesn`t respect the target position

Hi, i was using the 18.1.0.55 version and opening the context menu by a click with cxtMenu.Open(e.ClientX, e.ClientY), where e is 'Microsoft.AspNetCore.Components.Web.MouseEventArgs' and was working fine but after update to 18.2.0.47 version, the menu always open in 0,0 position at screen. There is a new way to do it? Thanks in advance.

3 Replies 1 reply marked as answer

CH Chet August 4, 2020 05:48 PM UTC

Are you using the css generated from Theme Studio?  We had a similar problem, using the css included in the component library.

      rel='nofollow' href="_content/Syncfusion.Blazor/styles/material.css"

Seems they are still some kinks in the Theme Studio generation since v18.2 was released.   


César August 4, 2020 07:06 PM UTC

Im using the bootstrap 4 version ("_content/Syncfusion.Blazor/styles/bootstrap4.css") and keep try to solve this problem. Debbuging the coordinates seems nice and the target works fine, but something sets top: 0 and left:0 in context menu wrapper element style attribute. 


MK Mohan Kumar Ramasamy Syncfusion Team August 5, 2020 08:21 AM UTC

Hi Cesar, 
 
Sorry for the inconvenience caused.  
 
We have provided the generic type support for context menu component. We have changed the Open method arguments. Could you please find the below code snippet. 
<div class="control-section"> 
    <div class="contextmenu-control"> 
        <div id="contextmenutarget">Right click/Touch hold to open the ContextMenu</div> 
        <SfContextMenu @ref="ConextMenuObj" Target="#contextmenutarget" Items="@MenuItems"></SfContextMenu> 
    </div> 
</div> 
 
<SfButton Content="Open" OnClick="OpenMethod"> </SfButton> 
@code{ 
    SfContextMenu<MenuItem> ConextMenuObj; 
 
    private void OpenMethod(MouseEventArgs args) 
    { 
        ConextMenuObj.Open(args.ClientX, args.ClientY); 
    } 
} 
 
For your reference, we have prepared a sample based on this, please refer below link. 
 
 
Please note that we have introduced several API break in this release. We would like you to review the breaking changes from the below location before you upgrade.

Link: https://blazor.syncfusion.com/documentation/release-notes/18.2.44/?type=all#context-menu 
 
Please let us know if you need any further assistance, 
 
Regards, 
Mohankumar R 


Marked as answer
Loader.
Up arrow icon