instructure-react / react-tinymce

React TinyMCE component
181 stars 110 forks source link

How to put some default text in one specific TinyMCE editor? #85

Open arunkannath opened 6 years ago

arunkannath commented 6 years ago

Tried below code: onActivate={e=>initialiseValue(e,this.props.value)} //props.value has def text

function initialiseValue(e,val){
if(val!=""&&val!=undefined){

   e.target.setContent(e.target.getContent()+val);
}
}

The problem here is, everytime I click on tinyMCE editor field, it is putting the value over and over. I want the value to be added at first time while loading and not anymore after that. Tried onLoadContent, but it didn't fire setContent() method. Please help.

omarchehab98 commented 6 years ago

content prop