Skip to content

Commit

Permalink
fix: don't bother lifting col/row classes if we don't have any to lift
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnetau committed Oct 19, 2023
1 parent 1a38600 commit e012b8b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ const processClassName = (data, field) => {

if (classes && classes.length > 0) {
className += ` ${classes.join(' ')}`
}

// Now that the row- & col- types were lifted, remove from the actual input field and any child elements
if (field.classList) {
field.classList.remove(...classes)
}
// Now that the row- & col- types were lifted, remove from the actual input field and any child elements
if (field.classList) {
field.classList.remove(...classes)
}

//field may be a single element, dom fragment, or an array of elements
if (!Array.isArray(field)) {
field = [field]
}
field.forEach(item => item.querySelectorAll('[class*=row-],[class*=col-]').forEach(element => {
if (element.classList) {
element.classList.remove(...classes)
//field may be a single element, dom fragment, or an array of elements
if (!Array.isArray(field)) {
field = [field]
}
}))
field.forEach(item => item.querySelectorAll('[class*=row-],[class*=col-]').forEach(element => {
if (element.classList) {
element.classList.remove(...classes)
}
}))
}
}

return className
Expand Down

0 comments on commit e012b8b

Please sign in to comment.