Skip to content

Commit

Permalink
fix: transform camelCase to kebab-case
Browse files Browse the repository at this point in the history
cropperjs requires the attributes set on the element to be kebab-case
  • Loading branch information
NamesMT committed Apr 6, 2024
1 parent 3695e54 commit 5c3f550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ModernCropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function setElementAttributes(element: HTMLElement, attributes: Record<any, any>
if (value === false || value === null)
return element.removeAttribute(attribute)
element.setAttribute(attribute, value)
element.setAttribute(attribute.replaceAll(/([a-z])([A-Z])/g, '$1-$2'), value)
})
}
// process passThrough options
Expand Down

0 comments on commit 5c3f550

Please sign in to comment.