mirror of
https://github.com/strapi/strapi.git
synced 2025-09-18 21:08:54 +00:00
Fix wysiwyg lifecycle
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
62024242ae
commit
19f61f4b79
@ -125,9 +125,19 @@ class Wysiwyg extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the content when used in a dynamiczone
|
// Update the content when used in a dynamiczone
|
||||||
|
// We cannot update the value of the component each time there is a onChange event
|
||||||
|
// fired otherwise the component gets very slow
|
||||||
if (prevProps.value !== this.props.value && !this.state.isFocused) {
|
if (prevProps.value !== this.props.value && !this.state.isFocused) {
|
||||||
this.setInitialValue(this.props);
|
this.setInitialValue(this.props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Here we need to update the content of editorState for the edition case
|
||||||
|
// With the current architecture of the EditView we cannot rely on the componentDidMount lifecycle
|
||||||
|
// Since we need to perform some operations in the reducer the loading phase stops before all the operations
|
||||||
|
// are computed which in some case causes the inputs component to be initialised with a null value.
|
||||||
|
if (!prevProps.value && this.props.value) {
|
||||||
|
this.setInitialValue(this.props);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user