Skip to content
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

[Chrome, Edge] Exception after pressing CTRL + U while content is selected #718

Closed
Mgsy opened this issue Dec 13, 2017 · 6 comments
Closed
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Mgsy
Copy link
Member

Mgsy commented Dec 13, 2017

🐞 Is this a bug report or feature request? (choose one)

  • Bug report

💻 Version of CKEditor

1.0.0-alpha2

📋 Steps to reproduce

Scenario 1

  1. Go to http://localhost:8125/ckeditor5-core/tests/manual/article.html.
  2. Select the image caption.
  3. Press Ctrl + U (it's still Ctrl in MacOS).

Scenario 2

  1. Go to http://localhost:8125/ckeditor5-core/tests/manual/article.html.
  2. Select two list items.
  3. Press Ctrl + U (it's still Ctrl in MacOS).

✅ Expected result

Nothing happens.

❎ Actual result

There is the error in the console and in Chrome the selection has moved to the beginning of the document.

📃 Other details that might be useful

Error

input.js:205 Uncaught TypeError: modelFromCurrentDom.getChildren is not a function
    at MutationHandler._handleContainerChildrenMutations (input.js:205)
    at MutationHandler.handle (input.js:147)
    at Input._handleMutations (input.js:105)
    at Document.listenTo (input.js:50)
    at Document.fire (emittermixin.js:269)
    at MutationObserver._onMutations (mutationobserver.js:248)

GIF

bug_cke5

Notes

It doesn't occur if the underline plugin is loaded.

Other information

OS: Windows 10, MacOS X
Browser: Chrome, Edge

@Mgsy Mgsy added the type:bug This issue reports a buggy (incorrect) behavior. label Dec 13, 2017
@Mgsy Mgsy added this to the iteration 14 milestone Dec 13, 2017
@Reinmar
Copy link
Member

Reinmar commented Dec 13, 2017

This is a good one. I guess that a native underline comes into action and breaks our mutation observer.

@scofalik
Copy link
Contributor

scofalik commented Feb 21, 2018

I wonder what's up, cause I can't reproduce it, while @Mgsy says that it is fixed for caption but still crashes for list items.

EDIT: Okay, yeah, whatever, as usual it suddenly started to be broken for me aswell, but just after writing a comment.

@scofalik
Copy link
Contributor

Although, when I click Cmd + U, I don't get an underline, instead I get this sign: ¨ and composition starts (I guess) and this crashes when there is a multielement selection.

@Reinmar
Copy link
Member

Reinmar commented Feb 22, 2018

BTW, on my MacOS at least, with Polish Pro keyboard the keystroke which is worth testing is Alt+U.

Pressing Alt+U enters umlaut composition. So Alt+U,U inserts "ü". This works fine on Firefox and Chrome in some cases now, but crashes on the two-lists-item-selection. After #140 it simply stops crashing in the two-lists-item-selection case, but it will do nothing in Chrome (in FF, it works fine). Which is fine for now. Let's see if anyone will ever report it.

@Reinmar Reinmar modified the milestones: iteration 15, iteration 14 Feb 22, 2018
Reinmar added a commit to ckeditor/ckeditor5-typing that referenced this issue Feb 22, 2018
Fix: Editor should not crash in scenarios when mutations' common ancestor could not be mapped to the model. Closes ckeditor/ckeditor5#718.
@scofalik
Copy link
Contributor

Did you check if other keystrokes (Cmd+U, Ctrl+U) crash the editor?

@Reinmar
Copy link
Member

Reinmar commented Feb 22, 2018

I tried all combinations with U. For some reason Ctrl+U crashes the editor on master, but at the same time, this keystroke has no action even here, in a textarea or in CKEditor 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants