check presence of overlap[i]

pull/1937/head
Victor Baranov 6 years ago
parent 00e46e5fba
commit 365d12c185
  1. 4
      apps/block_scout_web/assets/js/lib/list_morph.js

@ -42,8 +42,8 @@ export default function (container, newElements, { key, horizontal } = {}) {
// update kept items // update kept items
currentList = currentList.map(({ el }, i) => ({ currentList = currentList.map(({ el }, i) => ({
id: overlap[i].id, id: overlap[i] && overlap[i].id,
el: el.outerHTML === overlap[i].el.outerHTML ? el : morph(el, overlap[i].el) el: el.outerHTML === overlap[i] && overlap[i].el && overlap[i].el.outerHTML ? el : morph(el, overlap[i].el)
})) }))
// add new items // add new items

Loading…
Cancel
Save