I have a custom editor which contains an input control. By default, when the editor opens, the input control has focus and I can type as expected. I want to look for /use the “enter” key for a special function…but right now, this causes cell to close. If I physically click into the input control and then use the enter key, it’s fine.
I found on this page https://handsontable.com/docs/7.3.0/tutorial-cell-editor.html that you can register onKeyDown event within the editor and maybe suppress the grid function?
Do you have an example which shows how to setup a custom editor , such that the enter key on an input focus could be processed locally and not have this close/save the editor?
Also note, I did try this in the grid. This does effectively stop the Enter key from closing/saving…however, in my editor component, I can no longer get/detect the event.keyCode===13 which I need to do for my logic.
I need a way to block default behavior in grid, but allow Enter key to be accessible within my component. Is this possible?
beforeKeyDown: (event) => {
if (event.code === ‘Enter’ ) {
event.stopImmediatePropagation();
}
},