Browse Source

Fix text selection

vanilla_orig
Christopher Chedeau 5 years ago
parent
commit
aeb11989e3
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      src/index.js

+ 7
- 5
src/index.js View File

148
   }
148
   }
149
   return (
149
   return (
150
     <div>
150
     <div>
151
-      <ElementOption type="rectangle">Rectangle</ElementOption>
152
-      <ElementOption type="ellipse">Ellipse</ElementOption>
153
-      <ElementOption type="arrow">Arrow</ElementOption>
154
-      <ElementOption type="text">Text</ElementOption>
155
-      <ElementOption type="selection">Selection</ElementOption>
151
+      {/* If using a component, dragging on the canvas also selects the label text which is annoying.
152
+          Not sure why that's happening */}
153
+      {ElementOption({ type: "rectangle", children: "Rectangle" })}
154
+      {ElementOption({ type: "ellipse", children: "Ellipse" })}
155
+      {ElementOption({ type: "arrow", children: "Arrow" })}
156
+      {ElementOption({ type: "text", children: "Text" })}
157
+      {ElementOption({ type: "selection", children: "Selection" })}
156
       <canvas
158
       <canvas
157
         id="canvas"
159
         id="canvas"
158
         width={window.innerWidth}
160
         width={window.innerWidth}

Loading…
Cancel
Save