diff --git a/blocks/FileItem/FileItem.js b/blocks/FileItem/FileItem.js index 8b1a583a6..2bde9438e 100644 --- a/blocks/FileItem/FileItem.js +++ b/blocks/FileItem/FileItem.js @@ -69,9 +69,10 @@ export class FileItem extends Block { } initCallback() { + super.initCallback(); this.bindCssData('--cfg-thumb-size'); this.defineAccessor('entry-id', (id) => { - if (!id) { + if (!id || id === this.uid) { return; } /** @type {String} */ diff --git a/blocks/UploadList/UploadList.js b/blocks/UploadList/UploadList.js index 0b754f1d9..224350146 100644 --- a/blocks/UploadList/UploadList.js +++ b/blocks/UploadList/UploadList.js @@ -124,11 +124,15 @@ export class UploadList extends Block { let fr = document.createDocumentFragment(); Object.values(this._renderMap).forEach((el) => fr.appendChild(el)); this.ref.files.replaceChildren(fr); - Object.entries(this._renderMap).forEach(([id, el]) => { + Object.keys(this._renderMap).forEach((id) => { + /** @type {Block} */ + let el = this._renderMap[id]; // rendering components async improves initial list render time a bit setTimeout(() => { el['entry-id'] = id; - el.render(); + if (!el.innerHTML) { + el.render(); + } }); }); });