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

polymer-quill doesn't work in Shadow DOM #10

Closed
abdonrd opened this issue Feb 10, 2017 · 7 comments
Closed

polymer-quill doesn't work in Shadow DOM #10

abdonrd opened this issue Feb 10, 2017 · 7 comments
Assignees

Comments

@platoscave
Copy link

platoscave commented Feb 23, 2017

+1
The funny thing is, I initially get a layout that is messed up (below). When I click on one of the radio buttons it turns back to normal. I'm using chrome v55.

image

@chuckh chuckh self-assigned this Mar 16, 2017
@chuckh
Copy link
Owner

chuckh commented Mar 16, 2017

Currently Quilljs does not work with Shadow DOM. Will give it another try with Shadow DOM when porting to Polymer 2.0.

See issue for more information: slab/quill#904

@satyanath
Copy link

I have a working hack. I had to modify both quill and the polymer-quill to get it working. As mentioned this is a hack and definitely not suitable for production use. As I have very little free time I could not do a pull request. I am attaching the files which I modified. If you find the hack suitable you can use it to modify the code and get it working in shadowDom.

To summarize the changes are as follows

Quill.js

  1. Modified to not run the factory function at the beginning and save that function in a variable.
  2. Added an argument qComponent to store the component (rather shadowRoot) of the component.
  3. Pass the qComponent to the other objects called where quill is not passed.
  4. Modify the places where document is used (leaving out places where createElement is called) to use qComponent instead.

Polymer-quill

  1. Moved to the code from ready routine to attached (this step may not be necessary).
  2. Modified the styles in polymer-quill-styles-snow.html to remove :host and ::content
  3. Modified to call the saved factory function first and then call the Quill function. The quill function is now called with the component reference.

I have used it in my project and it is getting tested along with other things. Please do a diff to find out all the changes. Review and only then include the changes appropriately.
pquill.zip

This can be modified to work both with shady DOM and shadow DOM. I just needed only shadow DOM for my project.

Hope this is of some use.
pquill.zip

@satyanath
Copy link

satyanath commented Jun 30, 2017 via email

@Asha-N
Copy link

Asha-N commented Jul 13, 2017

satyanath sir,
This hack works only for chrome. How to make it work for IE and firefox ?

This is how it looks on firefox and IE browsers :
image

@satyanath
Copy link

satyanath commented Jul 17, 2017 via email

@abdonrd
Copy link
Author

abdonrd commented Jul 18, 2019

Closing and old issue.

@abdonrd abdonrd closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants