Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix relationships on mobile

Guy Ben-Aharon48a5542c32d0
diff --git a/src/pages/editor-page/canvas/table-node/table-node-field.tsx b/src/pages/editor-page/canvas/table-node/table-node-field.tsx
index 10a2c9e7..90e7f909 100644
--- a/src/pages/editor-page/canvas/table-node/table-node-field.tsx
+++ b/src/pages/editor-page/canvas/table-node/table-node-field.tsx
@@ -64,48 +64,48 @@ export const TableNodeField: React.FC<TableNodeFieldProps> = React.memo(
: 'z-0 max-h-0 overflow-hidden opacity-0'
}`}
>
- {!connection.inProgress && (
- <>
+ {/* {!connection.inProgress && ( */}
+ <>
+ <Handle
+ id={`${RIGHT_HANDLE_ID_PREFIX}${field.id}`}
+ className={`!h-4 !w-4 !border-2 !bg-pink-600 ${!focused ? '!invisible' : ''}`}
+ position={Position.Right}
+ type="source"
+ />
+ <Handle
+ id={`${LEFT_HANDLE_ID_PREFIX}${field.id}`}
+ className={`!h-4 !w-4 !border-2 !bg-pink-600 ${!focused ? '!invisible' : ''}`}
+ position={Position.Left}
+ type="source"
+ />
+ </>
+ {/*)}
+ {(!connection.inProgress || isTarget) && ( */}
+ <>
+ {Array.from(
+ { length: numberOfEdgesToField },
+ (_, index) => index
+ ).map((index) => (
<Handle
- id={`${RIGHT_HANDLE_ID_PREFIX}${field.id}`}
- className={`!h-4 !w-4 !border-2 !bg-pink-600 ${!focused ? '!invisible' : ''}`}
- position={Position.Right}
- type="source"
- />
- <Handle
- id={`${LEFT_HANDLE_ID_PREFIX}${field.id}`}
- className={`!h-4 !w-4 !border-2 !bg-pink-600 ${!focused ? '!invisible' : ''}`}
- position={Position.Left}
- type="source"
- />
- </>
- )}
- {(!connection.inProgress || isTarget) && (
- <>
- {Array.from(
- { length: numberOfEdgesToField },
- (_, index) => index
- ).map((index) => (
- <Handle
- id={`${TARGET_ID_PREFIX}${index}_${field.id}`}
- key={`${TARGET_ID_PREFIX}${index}_${field.id}`}
- className={`!invisible`}
- position={Position.Left}
- type="target"
- />
- ))}
- <Handle
- id={`${TARGET_ID_PREFIX}${numberOfEdgesToField}_${field.id}`}
- className={
- isTarget
- ? '!absolute !left-0 !top-0 !h-full !w-full !transform-none !rounded-none !border-none !opacity-0'
- : `!invisible`
- }
+ id={`${TARGET_ID_PREFIX}${index}_${field.id}`}
+ key={`${TARGET_ID_PREFIX}${index}_${field.id}`}
+ className={`!invisible`}
position={Position.Left}
type="target"
/>
- </>
- )}
+ ))}
+ <Handle
+ id={`${TARGET_ID_PREFIX}${numberOfEdgesToField}_${field.id}`}
+ className={
+ isTarget
+ ? '!absolute !left-0 !top-0 !h-full !w-full !transform-none !rounded-none !border-none !opacity-0'
+ : `!invisible`
+ }
+ position={Position.Left}
+ type="target"
+ />
+ </>
+ {/* )} */}
<div className="block truncate text-left">{field.name}</div>
<div className="flex max-w-[35%] justify-end gap-2 truncate hover:shrink-0">
{field.primaryKey ? (