From ff02eeecaf693cad70589bc92e7ecb364397a7b9 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 12 May 2025 09:55:41 +0200 Subject: [PATCH 1/3] fix(panel-position): do not use margin for gaps #4431 --- packages/system/src/styles/init.css | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/system/src/styles/init.css b/packages/system/src/styles/init.css index ca4d6de7..ad364dba 100644 --- a/packages/system/src/styles/init.css +++ b/packages/system/src/styles/init.css @@ -268,14 +268,13 @@ svg.xy-flow__connectionline { .xy-flow__panel { position: absolute; z-index: 5; - margin: 15px; &.top { - top: 0; + top: 15px; } &.bottom { - bottom: 0; + bottom: 15px; } &.top, @@ -287,11 +286,11 @@ svg.xy-flow__connectionline { } &.left { - left: 0; + left: 15px; } &.right { - right: 0; + right: 15px; } &.left, From 2a03213b0695d504f831579ec9df3f9de2d3e0bd Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 12 May 2025 09:56:23 +0200 Subject: [PATCH 2/3] chore(changeset): add --- .changeset/itchy-pumas-share.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/itchy-pumas-share.md diff --git a/.changeset/itchy-pumas-share.md b/.changeset/itchy-pumas-share.md new file mode 100644 index 00000000..09c4dc6e --- /dev/null +++ b/.changeset/itchy-pumas-share.md @@ -0,0 +1,5 @@ +--- +'@xyflow/system': patch +--- + +Center panel correctly when bottom-center or top-center position is used From ee509176cb1a6766d20700c0d822554accc755ac Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 12 May 2025 11:59:58 +0200 Subject: [PATCH 3/3] chore(panel): less intrusive fix --- packages/system/src/styles/init.css | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/system/src/styles/init.css b/packages/system/src/styles/init.css index ad364dba..5f082ff8 100644 --- a/packages/system/src/styles/init.css +++ b/packages/system/src/styles/init.css @@ -268,36 +268,37 @@ svg.xy-flow__connectionline { .xy-flow__panel { position: absolute; z-index: 5; + margin: 15px; &.top { - top: 15px; + top: 0; } &.bottom { - bottom: 15px; + bottom: 0; } &.top, &.bottom { &.center { left: 50%; - transform: translateX(-50%); + transform: translateX(-15px) translateX(-50%); } } &.left { - left: 15px; + left: 0; } &.right { - right: 15px; + right: 0; } &.left, &.right { &.center { top: 50%; - transform: translateY(-50%); + transform: translateY(-15px) translateY(-50%); } } }