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

JS error when marking text with mixed alignment in 1.0 #815

Closed
crisbeto opened this issue Jul 25, 2016 · 5 comments
Closed

JS error when marking text with mixed alignment in 1.0 #815

crisbeto opened this issue Jul 25, 2016 · 5 comments

Comments

@crisbeto
Copy link

crisbeto commented Jul 25, 2016

When marking two paragraphs with a mixed alignment (e.g. right and center), Quill throws an error.

Steps for Reproduction

  1. Go to the 1.0 homepage.
  2. Clear the editor and paste a couple of paragraphs of text (note that apparently there can't be an empty paragraph between them).
  3. Press ctrl+a to mark everything. At this point the following error is logged:
quill.js:9041 Uncaught TypeError: Cannot read property 'innerHTML' of nullselectItem @ quill.js:9041update @ quill.js:8907(anonymous function) @ quill.js:9543update @ quill.js:9542emit @ quill.js:4181emit @ quill.js:4002update @ quill.js:5585

Extra: I couldn't really paste over the text with the formatting to GitHub, but here's what the text looks like:

cxu60vl

Platforms: Chrome 52 on Windows 10

Version: 1.0.0-beta.9

@jhchen
Copy link
Member

jhchen commented Jul 25, 2016

What application are you pasting from? I'm not able to reproduce.

@crisbeto
Copy link
Author

crisbeto commented Jul 25, 2016

I'm pasting it from here. Also here's a recording of the steps that I'm taking:

a

@benbro
Copy link
Contributor

benbro commented Jul 25, 2016

Maybe you can paste the delta to help reproducing the issue:

console.log(JSON.stringify(quill.getContents()));

@jacobmllr95
Copy link
Contributor

Here the delta to reproduce it:

{"ops":[{"insert":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."},{"attributes":{"align":"right"},"insert":"\n"},{"insert":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."},{"attributes":{"align":"center"},"insert":"\n"}]}

And here is the fix aa26d1d.

@jhchen
Copy link
Member

jhchen commented Jul 25, 2016

Thanks for the video @crisbeto I was able to reproduce from that example. @jackmu95 Thanks for your suggested commit but the issue is the picker still needs to revert back the the default option.

@jhchen jhchen closed this as completed in fea4463 Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants