How to prevent drag kanban cards when right click

I have added context menu for cards but sometimes when right click the cards, i will accidentally drag cards. Any solution/workaround to prevent this?


1 Reply

BS Buvana Sathasivam Syncfusion Team April 4, 2022 04:45 AM UTC

Hi Sheng,


Greetings from Syncfusion support.


We have created a sample using the context menu. We suggest enabling the args.cancel on dragStart event when the context menu opens state. Please find the below code and sample for your reference.

app.component.html

<ejs-kanban

      (dragStart)="dragStart($event)"

    >

    </ejs-kanban>


app.component.ts

 public dragStart(argsDragEventArgs) {

    if (document.querySelector('.e-contextmenu').style.display == 'block') {

      args.cancel = true;

    }

  }


Sample: https://stackblitz.com/edit/angular-zdyfh4?file=app.component.ts


Please check the above solution, If still problem persist, can you please share the video with your issue or modify the above sample to reproduce your issue.


Regards,

Buvana S


Loader.
Up arrow icon