File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export function FormInstance(config) {
1818
1919 this . eventListeners = null ;
2020
21+ this . _dataSynced = false ;
22+
2123 this . addEventListener = function ( event , listener ) {
2224 if ( this . eventListeners === null )
2325 this . eventListeners = { } ;
@@ -31,6 +33,12 @@ export function FormInstance(config) {
3133 this . onChange = function ( e ) {
3234 this . data = e . data ;
3335
36+ if ( ! this . _dataSynced ) {
37+ // this is the first change event for syncing data
38+ this . _dataSynced = true ;
39+ return ;
40+ }
41+
3442 if ( ! this . eventListeners )
3543 return ;
3644
@@ -118,6 +126,7 @@ export class FormContainer extends React.Component {
118126 }
119127
120128 componentDidMount ( ) {
129+ this . props . onChange ( { data : this . state . editorState . getData ( ) } ) ;
121130 this . populateDataInput ( this . state . editorState . getData ( ) ) ;
122131 }
123132
You can’t perform that action at this time.
0 commit comments