Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Always having an empty paragraph at the end of the document #143
Thanks for the feedback. I tried to implement it this way, but indeed I didn't get it working correctly. The problem was that this empty last element would not automatically change to a regular
I asked on the ProseMirror list, maybe they have an idea: https://discuss.prosemirror.net/t/empty-trailing-block/2072
@holtwick if you find any solutions I'd love to hear it. The use case for our project is embedding textinputs into the notes so we can update values in a 3rd party application. Like in the embed Scrumpy example, it gets stuck immediately thereafter. Workarounds or fixes, I'm all ears!
As mentioned in the linked Prosemirror thread that @holtwick opened, gapcursor does kind of work (you just need to set showGapCursor: true on the node), but it's far from a complete solution. You can change the CSS for the cursor, but I was having trouble making it appear consistently. Now it only really appears when you are on the selection point after the node, rather than on the node itself; this would be a fine solution if there was an intuitive way to present this to the user, but I haven't figured that part out.
Really what I settled on is this:
Finally, in my component, I set the cursor position to the NodeView when the
Again, far from a perfect solution, but hopefully this will help others looking into similar use cases. I had some jankier solutions for ensuring there was always a trailing paragraph (I threw those out), but we won't talk about those