I have a case with a custom bullet point list where each item has a score.
I need to add scores when two items are joined. For example, when the user hits Backspace at the beginning of a line, the resulting item’s score would be the addition of the two item’s score.
I did a quick hack to showcase the idea by overriding
Transform.prototype.join but I am wondering what would be the correct way to do it.
My first thought is to write my own Backspace command on the custom node, but there’s a lot of code to copy/paste just to change the way
join works. And it would not cover other join scenarios like hitting Delete at the end of a line, etc.
Is it possible to have a custom
join defined for a custom node ?
Thanks for your help or any hint !