We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7710826 commit b25ee8bCopy full SHA for b25ee8b
index.js
@@ -18,6 +18,7 @@ tmpl.innerHTML = `
18
19
const startPositions = new WeakMap()
20
const dragStartPositions = new WeakMap()
21
+const constructedElements = new WeakMap()
22
23
function moveCropArea(event: MouseEvent | KeyboardEvent) {
24
const el = event.currentTarget
@@ -182,6 +183,9 @@ class ImageCropElement extends HTMLElement {
182
183
box: HTMLElement
184
185
connectedCallback() {
186
+ if (constructedElements.has(this)) return
187
+ constructedElements.set(this, true)
188
+
189
this.appendChild(document.importNode(tmpl.content, true))
190
191
const image = this.querySelector('img')
0 commit comments