Skip to content

Commit 50f1c3e

Browse files
committed
v5.3.4
1 parent 493a3b8 commit 50f1c3e

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "5.3.3",
3+
"version": "5.3.4",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/drops/drop/useMakeUpdatePosition.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ export default (target, dropRef, align, stretch, canHideTarget, keepHorizontal)
7878
useCallback(() => {
7979
if (!dropRef.current) return
8080

81-
styles.forEach(position => (dropRef.current.style[position] = ""))
82-
8381
const targetRect = target.getBoundingClientRect()
8482
const dropRect = dropRef.current.getBoundingClientRect()
8583

8684
const width = getWidth(stretch, targetRect, dropRect)
8785
dropRect.width = width
8886

8987
const animate = () => {
88+
if (!dropRef.current) return
89+
90+
styles.forEach(position => (dropRef.current.style[position] = ""))
91+
9092
const x = getXPosition(align, targetRect, dropRect, canHideTarget)
9193
const y = getYPosition(align, targetRect, dropRect, canHideTarget)
9294

93-
if (!dropRef.current) return
94-
9595
if (!keepHorizontal || !dropRef.current.style.left) {
9696
dropRef.current.style.left = `${x}px`
9797
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import getAncestors from "./getAncestors"
22

3-
export default (parent, target) => getAncestors(target).some(node => node === parent)
3+
export default (parent, target) => {
4+
const ancestors = getAncestors(target)
5+
if (ancestors.length === 0) return false
6+
return ancestors.some(node => node === parent)
7+
}

0 commit comments

Comments
 (0)