javascript - Using the Wiris editor within a Web Component -


i have created web component hosts wiris. when component rendered wiris editor (very) badly formed:

enter image description here

you can see issue live here.

the code follows:

class wiriscomponent extends htmlelement {  constructor() {   // call super first in constructor   super();    // create shadow root   var shadow = this.attachshadow( { mode: 'open' } );    // create div host wiris editor   var div = document.createelement('div');   div.id = 'editorcontainer';    var wirisdefaultconfig = {     'language': 'en'   };    var editor = com.wiris.jseditor.jseditor.newinstance(wirisdefaultconfig);    // insert wiris instance div   editor.insertinto(div);          // append shadow route   shadow.appendchild(div);  } }  // define new element customelements.define('wiris-component', wiriscomponent); 

and html mark-up is:

<wiris-component></wiris-component> 

note i've tried in chrome have full support web components.

any idea problem is? problem related styling issue found in this issue?

don't use shadow dom: styles imported library not working it.

class wiriscomponent extends htmlelement {    connectedcallback() {      var wirisdefaultconfig = {        'language': 'en'      };        var editor = com.wiris.jseditor.jseditor.newinstance(wirisdefaultconfig);      editor.insertinto(this);    }  }    // define new element  customelements.define('wiris-component', wiriscomponent);
<script src="https://www.wiris.net/demo/editor/editor"></script>  <wiris-component></wiris-component>


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -