-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Browser crashes with specific cursor movement around images #1910
Comments
Did you report it to the browser vendors? |
I did not. This is not a problem with |
There are more scenarios that will cause the browser crash. The example above is the smallest one I could find. If there is any non-whitespace text after the images everything works fine. |
A browser crash is always a problem with the browser. A web page shouldn't be able to crash a browser. |
I think it is more accurate to say the browser locks up but it looks like it affects vanilla contenteditable:
The image / base64 image does not appear to be a factor: https://jsfiddle.net/k1ssqq70/1/. It does appear to require all three images and the leading space precisely to reproduce though. It may be possible to detect this shortcut in Quill and preventDefault to circumvent. |
Strange, I could not repro with a vanilla element earlier today. I must've made a mistake. I've added a custom key binding in my Quill usage to catch this before it happens -- seems reasonable to do the same in Quill out of the box. |
Yes agreed. Are you just disabling the shortcut or re-implementing the effects of option+left arrow? |
"Re-implemented" in the sense that I'm moving the cursor to the left of the image. I'm not 100% sure that's the correct behavior for option+left, but it seems better than doing nothing |
Great thanks -- would you be willing to share the code for the keyboard shortcut handler? Also you mentioned there were other cases but this was the simplest. Did they all involve three images like this? It seems like a strange condition I wonder if the later images happen to always fulfill some other general case. |
There's a wide variety of combinations that will cause this problem:
Those were the cases I want through in my testing. |
Given specific editor contents and specific cursor position Chrome and Safari will reliably crash if you hit
option+left arrow
.Steps for Reproduction
option+left arrow
Expected behavior:
Cursor moves to the other side of the image
Actual behavior:
Browser crashes and browser tab has to be force quit
Platforms:
Mac. Chrome and Safari.
Version:
1.3.4
Illustration:
The text was updated successfully, but these errors were encountered: