|
@@ -83,6 +83,7 @@ class Editor extends React.Component {
|
83
|
83
|
if (fileList.length > this.props.maxUpload) {
|
84
|
84
|
list = fileList.slice(0, this.props.maxUpload);
|
85
|
85
|
}
|
|
86
|
+ this.props.handleChangeFileList(list);
|
86
|
87
|
this.setState({ fileList: list });
|
87
|
88
|
}
|
88
|
89
|
|
|
@@ -131,6 +132,10 @@ class Editor extends React.Component {
|
131
|
132
|
const files = [];
|
132
|
133
|
if (fileList.length) {
|
133
|
134
|
fileList.forEach(item => {
|
|
135
|
+ if (item.url) {
|
|
136
|
+ files.push(item.url);
|
|
137
|
+ return;
|
|
138
|
+ }
|
134
|
139
|
if (!fileMap[item.uid]) {
|
135
|
140
|
return;
|
136
|
141
|
}
|
|
@@ -180,6 +185,7 @@ class Editor extends React.Component {
|
180
|
185
|
emojiPopoverPlacement,
|
181
|
186
|
uploadPopoverPlacement,
|
182
|
187
|
uploadOverlayClassName,
|
|
188
|
+ fileList,
|
183
|
189
|
closeUploadWhenBlur,
|
184
|
190
|
maxUpload,
|
185
|
191
|
// btnSubmitText,
|
|
@@ -199,6 +205,7 @@ class Editor extends React.Component {
|
199
|
205
|
btnDisabled ||
|
200
|
206
|
(!this.props.value && !this.state.value && !this.state.fileList.length);
|
201
|
207
|
const inputValue = value || this.state.value;
|
|
208
|
+ const uploadFileList = fileList || this.state.fileList;
|
202
|
209
|
return (
|
203
|
210
|
<div className="comment-editor-container">
|
204
|
211
|
<div
|
|
@@ -279,7 +286,7 @@ class Editor extends React.Component {
|
279
|
286
|
onChangeFileList={this.handleChangeFileList}
|
280
|
287
|
onUpload={this.handleUpload}
|
281
|
288
|
maxUpload={maxUpload}
|
282
|
|
- fileList={this.state.fileList}
|
|
289
|
+ fileList={uploadFileList}
|
283
|
290
|
showError={this.props.showError}
|
284
|
291
|
onError={this.props.onError}
|
285
|
292
|
/>
|
|
@@ -293,7 +300,7 @@ class Editor extends React.Component {
|
293
|
300
|
{maxUpload >= 2 ? (
|
294
|
301
|
<span style={{ color: "#666", fontWeight: 400 }}>
|
295
|
302
|
{intl.get("editor.uploadCount", {
|
296
|
|
- count: maxUpload - this.state.fileList.length
|
|
303
|
+ count: maxUpload - uploadFileList.length
|
297
|
304
|
})}
|
298
|
305
|
</span>
|
299
|
306
|
) : null}
|