chuckh / polymer-quill

Polymer Quill Rich Text Editor
51 stars 29 forks source link

Not working on chrome ? #7

Closed jpicus closed 7 years ago

jpicus commented 7 years ago

Unable to make this works on Chrome, whereas it's working fine on Edge !

Just tried the basic example :

        <style is="custom-style">
  polymer-quill.full {
    --polymer-quill-editor-max-height: 600px;
    --polymer-quill-editor-min-height: 200px;
  }
</style>
  <!--      <h2>Full Toolbar, Show Results, Custom height (150px), Save as Deltas, Save every 1 second</h2>
        <polymer-quill
                content='{"ops":[{"insert":"Hello World! - Store as Delta"},{"attributes":{"header":2},"insert":"\n"}]}'
                class="full"
                store-as="delta"
                save-interval="1000"
                toolbar-type="full"
                show-results>
       </polymer-quill>

On Edge : no problem :-)

On Chrome: get an error message(*) AND what's appearing is ...weird

(*) Uncaught SyntaxError: Unexpected token H in JSON at position 0 at JSON.parse () at HTMLElement. (VM997 polymer-quill.html:354) at VM884 polymer.html:1357 quill_chrome quill_edge

Here are two screenshot : the first is Chrome render, second one is Edge

chuckh commented 7 years ago

Do you have dom: 'shady' set in your index.html, like below? <polymer-quill> requires shady DOM to work.

<script>
      window.Polymer = {
        dom: 'shady',
        lazyRegister: true
      };
</script>

See https://github.com/chuckh/polymer-quill/blob/master/demo/index.html#L8-L13 for example.

jpicus commented 7 years ago

OK, now working ! Thanks

jpicus commented 7 years ago

Question: is the API available with polymer-quill ? (http://quilljs.com/docs/api/)

jpicus commented 7 years ago

Forgot that: dumb question