Angular material 2 tabs with ckeditor

I have a problem when trying to install ng2-ckeditor

to md-tab

from the angular -material2.

Here's the code:

Html

<md-tab-group>
    <md-tab>
        <ckeditor [(ngModel)]="content"></ckeditor>
    </md-tab>
</md-tab-group>

      

The problem is that I get an error when I click on something in ckeditor:

ckeditor.js: 438 Uncaught TypeError: Cannot read property 'getSelection' of undefined at CKEDITOR.dom.selection.getNative (ckeditor.js: 438) at CKEDITOR.dom.selection (ckeditor.js: 436) at a.CKEDITOR. editor.getSelection (ckeditor.js: 434) to $ .onOpen (ckeditor.js: 721) to $ .d.onShow (ckeditor.js: 697) to $ .showBlock (ckeditor.js: 716) to $ .e [ as click] (ckeditor.js: 696) in Object.execute (ckeditor.js: 690) in ckeditor.js: 691 at ckeditor.js: 31 in Object.callFunction (ckeditor.js: 31) in HTMLAnchorElement.onclick (VM30482 -KkkPBxTMDSipcy86VCV: 1) `

What's weird is when it loads the tab (like 1sec) it displays fine.

Are there any solutions? Thank!

+3


source to share


2 answers


Hi, it looks like by adding divarea plugin it works: <ckeditor [(ngModel)]="content" [config]="{extraPlugins: 'divarea'}"></ckeditor>



0


source


I have a similar problem ( CkEditor and Angular Material 2 tabs ).

Thev divarea plugin didn't work, but I found out that if I put the CkEditor on a tab that is immediately visible (first one / selected) the editor works fine.



Maybe this will help someone.

0


source







All Articles