Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Add onDoubleClick for notes and areas as edit (#503)

Karen Mkrtumyan5a5304073ef0
diff --git a/src/components/EditorCanvas/Area.jsx b/src/components/EditorCanvas/Area.jsx
index 9eb82b57..03e69b69 100644
--- a/src/components/EditorCanvas/Area.jsx
+++ b/src/components/EditorCanvas/Area.jsx
@@ -128,6 +128,7 @@ export default function Area({
: "border-slate-400 opacity-100"
}`}
style={{ backgroundColor: `${data.color}66` }}
+ onDoubleClick={edit}
>
<div className="flex justify-between gap-1 w-full">
<div className="text-color select-none overflow-hidden text-ellipsis">
diff --git a/src/components/EditorCanvas/Note.jsx b/src/components/EditorCanvas/Note.jsx
index 48d859db..bc695340 100644
--- a/src/components/EditorCanvas/Note.jsx
+++ b/src/components/EditorCanvas/Note.jsx
@@ -135,6 +135,7 @@ export default function Note({ data, onPointerDown }) {
// https://stackoverflow.com/a/70976017/1137077
e.target.releasePointerCapture(e.pointerId);
}}
+ onDoubleClick={edit}
>
<path
d={`M${data.x + noteFold} ${data.y} L${data.x + noteWidth - noteRadius} ${