Displaying the context menu when no tasks exist

Hi,

For my project, I am considering updating from version 31.2.12 to the latest version.

However, I noticed that the behavior regarding the display of the context menu when no tasks exist has changed.

In the sample code below, when I right-click, the context menu appears in version 31.2.12, but it does not appear in the latest version (33.1.47).

I would like the context menu to appear in the latest version as well. Is there a workaround for this?

sample:https://stackblitz.com/edit/react-ggnufxgz?file=index.js


5 Replies

SJ Sridharan Jayabalan Syncfusion Team April 9, 2026 02:04 PM UTC

Hi Akira,

Greetings from Syncfusion.

 

For your query, we understand that the context menu does not open in the latest version of the Gantt chart when there are no records available.

This behavior is currently expected. In the Gantt component, the “Add” context menu item contains sub‑options such as Above, Below, Child, and Milestone. These options require at least one existing record to determine where the new task should be inserted.
For example, when selecting Below, there must be an existing record below which the new task can be added. Therefore, when there are no records to display, the default context menu is not rendered.

As a workaround, you can implement a custom context menu when the Gantt displays “No records to display”. In this custom context menu, you can include the options you need. If you want to support task addition, you can manually call the addRecord method of the Gantt component from your custom menu item. Since this is a custom implementation, the context menu actions must be handled programmatically.

Additionally, we are facing some issues while rendering the custom context menu on our end. Based on our analysis, we have identified this as a bug and logged it as: “Context menu not working when no records to display”. A fix for this issue is planned and will be included in an upcoming patch release scheduled for April 28, 2026. You can track the progress and status of this fix using the feedback link shared with you. 

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

 

 

Regards,

Sridharan



SJ Sridharan Jayabalan Syncfusion Team April 28, 2026 11:17 AM UTC

Akira,

 

Thanks for your patience.


We are glad to announce that we have included the fix for the issue “Context menu not working when no records to display” in our 33.2.4 release. So please upgrade to our latest version of the Syncfusion package to resolve the reported issue.


Root Cause - The open logic treated empty content the same as an invalid click and canceled the menu. Default-item filtering still depended on row data that does not exist in the empty state.


Solution - Allowed empty content-area opens when custom content items exist. Skipped row-dependent default-item logic in the empty state so only custom items remain.


 

Note - Default context menu items do not render; only custom context menu items are displayed when right‑clicking on the empty area where both chart and grid area. You can write your own logic inside the contextMenuClick event.

 

We thank you for your support and appreciate your patience in waiting for this release. Please get back to us if you need any further assistance.

 

Regards,

Sridharan



GI Gossip Idea May 28, 2026 03:56 AM UTC

I noticed the same kind of behavior when checking version changes between older and newer releases. It looks like the latest version may handle right-click events differently when the task area is empty, so the context menu is not triggered in the same way as before.

A possible workaround could be to bind the context menu to the empty schedule area or container element instead of only relying on task-based context events. This way, the menu can still appear even when there are no tasks available.

For teams working on custom scheduling interfaces or business web apps, this type of small UI behavior matters a lot. Companies like https://stackblitz.com/edit/react-ggnufxgz?file=index.js  https://dubaiweb.ae/  often focus on these details when building smooth and user-friendly web solutions.

 



AG Ajithkumar Gopalakrishnan Syncfusion Team June 1, 2026 07:01 AM UTC

Hi Customer,

Thank you for your observation and detailed analysis.

Yes, we would like to inform you that in the latest version, the Gantt Chart component handles right-click events differently compared to earlier releases, especially when the task area is empty. In this scenario, the context menu behavior is intentionally modified, as the default context menu items depend on row-specific data, which is not available in the empty state.

By handling the right‑click event at the container level, you can display a custom context menu even when no tasks are present. As mentioned in our previous update, with the recent fix, the default context menu will not be rendered in the empty state. However, custom context menu items can still be displayed and handled programmatically using events such as contextMenuClick.

For your use case, we recommend implementing a custom context menu for the empty area and invoking the required Gantt Chart methods (such as addRecord) manually based on your application requirements.

https://ej2.syncfusion.com/react/documentation/gantt/managing-tasks/adding-new-tasks#add-tasks-programmatically

We agree that such UI behaviors play an important role in delivering a smooth and user-friendly experience, especially in custom scheduling or business applications.

Please feel free to reach out if you need any assistance in implementing the custom context menu logic. We would be happy to help.

Regards
Ajithkumar G



GI Gossip Idea June 22, 2026 11:39 PM UTC

Checking the StackBlitz sample, it seems the context menu component in 33.1.47 conditionally renders based on active data nodes. When no tasks exist, the event hook simply returns null. Having reliable context menus is vital, whether you're building a web application or managing multi-window file injection scripts for modded versions of classic https://stackblitz.com/edit/react-ggnufxgz?file=index.js GTA games. Try injecting a ghost/empty data row with 0px height when the array is empty to trigger the version 33 context menu handler. Hope this helps!


Loader.
Up arrow icon