-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken in Shadow DOM #588
Comments
Does attached patch help? I couldn't see any issues with backspace, but I did notice the editor refusing to update its selection because it believed it wasn't focused. That should be fixed with this patch. |
Err, I meant patch ProseMirror/prosemirror-view@5dfbaab |
Hmm...patch doesn't seem to change anything for me, though I imagine probably still good to have in there. It looks like there are only issues when the cursor is at the end of the text string. For example, if I type 'Hello World' and the cursor is at the end, backspace and any arrow keys don't work. But if I click to somewhere in the middle I can use backspace / keys. Looks like it's in It's also coming up in I'm also getting errors in |
Could you try upgrading to version 0.19.0 (which I just released) and testing again? Maybe I had some other fix locally, and that's why I didn't see the problems. |
Ok so that seems to have fixed 99% of the issues - but seems like selection isn't working...so it seems to think any selection in Shadow DOM is empty. I've created another |
Looks like it's https://bugs.chromium.org/p/chromium/issues/detail?id=447523 that's causing the problem. Essentially means that With that workaround, selections seem to work, though there're some issues around focusing I believe...will continue investigating. @bradleyayers - I noticed you'd run into Shadow DOM issues with Prosemirror, did this come up at all, did you have any solutions? |
I've made a PR - that also fixes the focus issue I was having (same problem, just happening elsewhere). Let me know if you'd like me to change anything |
Thanks for digging into that! I assume you are aware of #476, which still kind of ruins attempts to use ProseMirror in a shadow dom on Safari? |
@marijnh no worries - thanks for ProseMirror 😃 Yeah I'm aware of that one, we're still using v0 Shadow DOM so don't run into the issue on Safari, but even the v1 Polyfills don't support it yet. I'm looking at ways to get around it - potentially a partial polyfill for that part of the spec, but won't be looking into it for awhile yet. |
@marijnh so looks like this is still broken - I mustn't have tested properly after this landed in a tagged release. Looks like this commit broke it, as I don't think there's a |
Ah, apologies. Does patch ProseMirror/prosemirror-view@931e286 help? |
Awesome - that'll do it, thanks @marijnh and no worries 😃 |
Using a trimmed down version of the basic setup, the editor seems to break pretty heavily if it's created within Shadow DOM. There's a lot of errors being thrown, most seem to be triggered during selection. See here for demo of it happening - ensure the log is open, and it shows the errors being thrown. Also can't seem to backspace?
Browser: Chrome 56, Mac
Module Versions: All version 0.18.0
HTML Code:
JS Code:
The text was updated successfully, but these errors were encountered: