I've created custom inline-blot and want to handle keyboard events on it.
In constructor
i wrote code like this:
class FooBlot extends Inline {
constructor(domNode, value){
super(domNode, value);
domNode.addEventListener('keydown', (event) => {this.keydown_handler(event)});
domNode.addEventListener('click', (event) => {this.click_handler(event)});
};
When i try to do something with my blot, only click event was handled, not keydown event.
You can see code example here. Open console, click on sometext and you will see "clicked" in console. But if you try to press some keyboard buttons, e.g. arrows, you will not see anything.
What the right way to handle keyboard events on my custom blot?