react-konva-utils
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -29,10 +29,10 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
} | ||
div.style.position = 'absolute'; | ||
div.style.zIndex = '10'; | ||
const _a = divProps || {}, { style } = _a, restProps = __rest(_a, ["style"]); | ||
Object.assign(div.style, style); | ||
Object.assign(div, restProps); | ||
if (shouldTransform) { | ||
if (shouldTransform && groupRef.current) { | ||
const tr = groupRef.current.getAbsoluteTransform(); | ||
const attrs = tr.decompose(); | ||
div.style.position = 'absolute'; | ||
div.style.zIndex = '10'; | ||
div.style.top = '0px'; | ||
@@ -43,2 +43,10 @@ div.style.left = '0px'; | ||
} | ||
else { | ||
div.style.position = ''; | ||
div.style.zIndex = ''; | ||
div.style.top = ''; | ||
div.style.left = ''; | ||
div.style.transform = ``; | ||
div.style.transformOrigin = ''; | ||
} | ||
}; | ||
@@ -65,2 +73,3 @@ React.useLayoutEffect(() => { | ||
var _a; | ||
group.off('_clearTransformCache', handleTransform); | ||
ReactDOM.unmountComponentAtNode(div); | ||
@@ -71,2 +80,5 @@ (_a = div.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(div); | ||
React.useLayoutEffect(() => { | ||
handleTransform(); | ||
}, [divProps]); | ||
React.useLayoutEffect(() => { | ||
ReactDOM.render(children, container.current); | ||
@@ -73,0 +85,0 @@ }); |
{ | ||
"name": "react-konva-utils", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Useful components and hooks for react-konva", | ||
@@ -21,2 +21,3 @@ "author": "Anton Lavrenov", | ||
}, | ||
"types": "./es/index.d.ts", | ||
"module": "./es/index.js", | ||
@@ -23,0 +24,0 @@ "files": [ |
10863
14
211