Hey guys, I am trying to build the logic where I can have only 1 Title component within the editor at all times. My schema looks like “title block+” which enforces the first block to always be Title and it works like a charm.
What I am struggling with is - when I press Enter in the middle of the Title string, the editor would split the node into 2 Title nodes, one after another. My ideal behaviour would be: when the user presses Enter - instead of having 2 Titles, they would have Title + Paragraph.
I’ve tried using appendTransaction
to detect the “replace step” and to change the second node into a paragraph? But now I am not sure… What would be the right way to handle this scenario?
Thanks.