Skip to content

Commit

Permalink
Merge pull request #636 from tokens-studio/interact-behind-toolbar
Browse files Browse the repository at this point in the history
Fixed not being able to drag nodes at same Y position as the toolbar
  • Loading branch information
mck authored Jan 15, 2025
2 parents d71228d + ae50f8b commit 1751227
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-balloons-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-editor": patch
---

Fixed not being able to drag nodes at the same vertical position as the toolbar
12 changes: 12 additions & 0 deletions packages/graph-editor/src/components/toolbar/toolbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
background-color: var(--color-neutral-canvas-default-bg);
color: var(--color-neutral-canvas-subtle-fg-default);
box-shadow: 0 2px 10px var(--color-neutral-800);
pointer-events: auto;
}

.wrapper {
position: absolute;
top: var(--size-250);
left: 0;
right: 0;
display: grid;
place-items: center;
z-index: 99;
pointer-events: none;
}

.separator {
Expand Down
13 changes: 2 additions & 11 deletions packages/graph-editor/src/editor/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import React, {
useState,
} from 'react';
import ReactFlow from 'reactflow';
import toolbarStyles from '../components/toolbar/toolbar.module.css';

import groupNode from '../components/flow/nodes/groupNode.js';
import noteNode from '../components/flow/nodes/noteNode.js';
Expand Down Expand Up @@ -812,17 +813,7 @@ export const EditorApp = React.forwardRef<
handleSelectNewNodeType={handleSelectNewNodeType}
/>
)}
<div
style={{
position: 'absolute',
top: 'var(--size-250)',
left: 0,
right: 0,
display: 'grid',
placeItems: 'center',
zIndex: '99',
}}
>
<div className={toolbarStyles.wrapper}>
<GraphToolbar />
</div>
{props.children}
Expand Down

0 comments on commit 1751227

Please sign in to comment.