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:

For example, if you enable the keyboard_navigation_cells config and use the taskRow scope, it will not work:

But if you don’t enable the config or specify the taskCell scope, it will work correctly:

@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.