Przeglądaj źródła

Only insert text on double click when selection is enabled (#1937)

This was an oversight to enable it for all the shapes. I don't believe that we want to be able to insert text on double click when drawing a rectangle for example. And it's definitely a broken experience when doing so for free draw.

Fixes part of #1935
Christopher Chedeau 5 lat temu
rodzic
commit
925db9dcca
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/components/App.tsx

+ 4 - 0
src/components/App.tsx

@@ -1746,6 +1746,10 @@ class App extends React.Component<ExcalidrawProps, AppState> {
     if (this.state.multiElement) {
     if (this.state.multiElement) {
       return;
       return;
     }
     }
+    // we should only be able to double click when mode is selection
+    if (this.state.elementType !== "selection") {
+      return;
+    }
 
 
     const selectedElements = getSelectedElements(
     const selectedElements = getSelectedElements(
       globalSceneState.getElements(),
       globalSceneState.getElements(),