-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
Cropper version
2.0.1
Link to minimal reproduction
https://unpkg.com/[email protected]/dist/cropper.js
Steps to reproduce
attribute crossorigin is not applied in 2.0.1 version.
#1253 fix the issue, but on npm
, 2.0.1 doesn't have this fix.
https://unpkg.com/[email protected]/dist/cropper.js
if (template && isString(template)) {
const templateElement = document.createElement('template');
const documentFragment = document.createDocumentFragment();
templateElement.innerHTML = template.replace(REGEXP_BLOCKED_TAGS, '<$1>');
documentFragment.appendChild(templateElement.content);
Array.from(documentFragment.querySelectorAll(CROPPER_IMAGE)).forEach((image) => {
image.setAttribute('src', src);
image.setAttribute('alt', element.alt || 'The image to crop');
});
if (element.parentElement) {
element.style.display = 'none';
container.insertBefore(documentFragment, element.nextSibling);
}
else {
container.appendChild(documentFragment);
}
}
What is expected?
Array.from(documentFragment.querySelectorAll(CROPPER_IMAGE)).forEach((image) => {
image.setAttribute('src', src);
image.setAttribute('alt', (element as HTMLImageElement).alt || 'The image to crop');
if (element instanceof HTMLImageElement && typeof element.crossOrigin === 'string') {
image.setAttribute('crossorigin', element.crossOrigin);
}
});
What is actually happening?
Array.from(documentFragment.querySelectorAll(CROPPER_IMAGE)).forEach((image) => {
image.setAttribute('src', src);
image.setAttribute('alt', element.alt || 'The image to crop');
});
System Info
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels