Detect key events in code tag in domObserver#114
Detect key events in code tag in domObserver#114seanchambo wants to merge 1 commit intoProseMirror:masterfrom
Conversation
|
Are you styling the |
|
Yup we are wrapping the |
|
And the browser only splits the |
|
Yes it splits into 2 |
|
Any ideas about this? I can send through the mutations from the domobserver if that helps? |
|
@marijnh just wanted to bump this |
|
A minimal self-contained setup that demonstrates the problem would help debug this. The markdown schema also has an inner |
|
Hey @marijnh I'm necroing this thread only because I work with Sean and have been working on newer problems arising that are fixed by this also. We have an issue where users on Android mobile cannot enter a new line while in a codeblock, and also if there is content after the cursor and the return key is pressed, that content is lost. I've created a reproduction for you to try out here: https://stackblitz.com/edit/js-jb8fcr?file=index.html I tested the PR suggested change locally, and without any other changes was able to resolve both the aforementioned issues :) Hopefully the reproduction helps, let me know if you need anything else. Open to suggestion on resolution, there may be something we've missed in our investigation. We're currently looking at a bump for our |
|
Hey @marijnh just a gentle bump ❤️ |
|
At a glance, your code blocks are rendered in an uneditable wrapper element, which is definitely not something this library supports. |

We currently have a
code blocknode that under the hood uses acodetag instead of aptag for better syntax highlighting. We were noticing on mobile that if you hit enter within the code block it would delete all the text after the place where the "Enter" was done.I believe this will fix the issue but also not sure if it is the best approach. I don't think on our end we are able to change to a
ptag now and must stick withcode.Have attached some videos to help show the issue. This is done on the iOS simulator BTW
after.mov
before.mov