What is the best practice to bind same key to different nodes?

when i’m writing in list item, i want the Tab key to run sinkListItem. but when i’m in a table cell, i want the Tab key to run goNextCell. +. i am using prosemirror-keymap module to bind keys.

Use chainCommands to bind multiple commands to the key, having each of them check whether it applies and return false otherwise.

1 Like

Thank you!