Skip to content

Commit

Permalink
fix: set eid if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 13, 2024
1 parent c7299f9 commit 097d15d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ function cloneTemplate(template) {

function insertElement(template, element, index, currentIndex) {
let eid = element.getAttribute('eid')
if (!eid)
console.log('attribute eid not found')
if (!eid) {
eid = uuid.generate(6)
element.setAttribute('eid', eid)
}

if (index !== null && index >= 0) {
if (!template.clones)
Expand Down

0 comments on commit 097d15d

Please sign in to comment.