Removing / Overwriting out-of-the-box keyboard navigation shortcuts

Hi, I would like to remove / overwrite out-of-the-box shortcuts from the keyboard navigation.

The one I would like to remove is “shift-up” on taskRow

If I use gantt.removeShortcut(“shift+up”, “taskRow”) it does NOT remove it.

If I use gantt.addShortcut(“shift+up”, () => {}, “taskRow”) it does NOT overwrite it.

Any ideas how to go about doing this?

Thank you

Hello Karl,
The shortcuts are added to the scopes, so you need to specify not only the shortcut, but also the scope:
https://docs.dhtmlx.com/gantt/desktop__keyboard_navigation.html#:~:text=To%20remove%20a%20shortcut%20from%20the%20scope%2C%20you%20need%20to%20use%20the%20removeShortcut%20method

https://docs.dhtmlx.com/gantt/desktop__keyboard_navigation.html#scopes

For example, if you enable the keyboard_navigation_cells config and use the taskRow scope, it will not work:
https://snippet.dhtmlx.com/qj8v0xab

But if you don’t enable the config or specify the taskCell scope, it will work correctly:
https://snippet.dhtmlx.com/vy757rgk
https://snippet.dhtmlx.com/kwhnmekx

@ramil Thank you for your answer.

So in this case, you have to specify “taskCell” for a shortcut that is on the task row? That seems a little bit conterintuitive.

Hello Karl,
As I said in the previous message, the shortcuts are added to the scopes. And the shift+up shortcut is bound not to the task row, but to the task object. You can collapse and expand tasks, but the task row is just a DOM element.
The task row only shows some task rows, but it can be configured to show completely different information that is not related to the task at all.

If you enable the keyboard_navigation_cells config, you can use the shortcuts of the taskCell scope, but the taskRow is not available. If the config is disabled, it works vice versa:
Keyboard Navigation Gantt Docs.