@@ -77,7 +77,7 @@ class WysiwygEditor extends Component {
7777 const newState = { } ;
7878 const { editorState, contentState } = this . props ;
7979 if ( ! this . state . toolbar ) {
80- const toolbar = mergeRecursive ( defaultToolbar , toolbar ) ;
80+ const toolbar = mergeRecursive ( defaultToolbar , this . state . toolbar ) ;
8181 newState . toolbar = toolbar ;
8282 }
8383 if (
@@ -216,9 +216,14 @@ class WysiwygEditor extends Component {
216216 decorators . push (
217217 ...getMentionDecorators ( {
218218 ...this . props . mention ,
219- onChange : this . onChange ,
219+ onChange : this . props ?. mention ?. onChange ? ( editorState , selectedSuggestion ) => {
220+ this . props . mention . onChange ( selectedSuggestion , editorState ) ;
221+ this . onChange ( editorState ) ;
222+ } : this . onChange ,
220223 getEditorState : this . getEditorState ,
221- getSuggestions : this . getSuggestions ,
224+ getSuggestions : this . props ?. mention ?. getSuggestions ? ( mentionText ) => {
225+ return this . props . mention . getSuggestions ( mentionText )
226+ } : this . getSuggestions ,
222227 getWrapperRef : this . getWrapperRef ,
223228 modalHandler : this . modalHandler ,
224229 } )
0 commit comments