Skip to content

Commit

Permalink
adds parent check to elements shifted within the dom, updates svg cle…
Browse files Browse the repository at this point in the history
…anup functions
  • Loading branch information
ja-ni committed Apr 8, 2024
1 parent ba7a702 commit 856200c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@react-facet/deferred-mount/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"bugs": "https://github.com/Mojang/ore-ui/issues",
"license": "MIT",
"version": "0.5.4",
"main": "src/index.tsx",
"main": "dist/index.js",
"publishConfig": {
"main": "dist/index.js",
"types": "dist/index.d.ts"
Expand Down
40 changes: 39 additions & 1 deletion packages/@react-facet/dom-fiber/src/setupHostConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@ export const setupHostConfig = (): HostConfig<
},

insertBefore: function (parentInstance, child, beforeChild) {
if (isElementContainer(child)) {
parentInstance.children.add(child)
}

parentInstance.element.insertBefore(child.element, beforeChild.element)
},

Expand All @@ -1027,6 +1031,10 @@ export const setupHostConfig = (): HostConfig<
},

insertInContainerBefore: function (container, child, beforeChild) {
if (isElementContainer(child)) {
container.children.add(child)
}

container.element.insertBefore(child.element, beforeChild.element)
},

Expand Down Expand Up @@ -1061,25 +1069,55 @@ const cleanupElementContainer = (parent: ElementContainer, instance: ElementCont
instance.children.clear()

instance.className?.()
instance.cx?.()
instance.cy?.()
instance.d?.()
instance['data-droppable']?.()
instance['data-narrate']?.()
instance['data-narrate-as']?.()
instance['data-narrate-after']?.()
instance['data-narrate-before']?.()
instance['data-testid']?.()
instance['data-x-ray']?.()
instance.fill?.()
instance.id?.()
instance.src?.()
instance.height?.()
instance.href?.()
instance.target?.()
instance.autoPlay?.()
instance.loop?.()
instance.disabled?.()
instance.maxLength?.()
instance.r?.()
instance.rx?.()
instance.ry?.()
instance.rows?.()
instance.value?.()
instance.stroke?.()
instance.strokeWidth?.()
instance.type?.()
instance.text?.()
instance.value?.()
instance.x?.()
instance.x1?.()
instance.x2?.()
instance.width?.()
instance.y?.()
instance.y1?.()
instance.y2?.()
instance.viewBox?.()
instance.xLinkHref?.()
instance.fillOpacity?.()
instance.strokeOpacity?.()
instance.strokeLinecap?.()
instance.strokeLinejoin?.()
instance.points?.()
instance.offset?.()
instance.stopColor?.()
instance.stopOpacity?.()
instance.fontFamily?.()
instance.fontSize?.()
instance.cohinline?.()
}

const noop = () => {}
Expand Down

0 comments on commit 856200c

Please sign in to comment.