Bläddra i källkod

Fix text selection

vanilla_orig
Christopher Chedeau 5 år sedan
förälder
incheckning
aeb11989e3
1 ändrade filer med 7 tillägg och 5 borttagningar
  1. 7
    5
      src/index.js

+ 7
- 5
src/index.js Visa fil

@@ -148,11 +148,13 @@ function App() {
148 148
   }
149 149
   return (
150 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 158
       <canvas
157 159
         id="canvas"
158 160
         width={window.innerWidth}

Laddar…
Avbryt
Spara