Explorar o código

perf: Limiting the suggested binding to fix performance issue (#6877)

Rahul %!s(int64=2) %!d(string=hai) anos
pai
achega
c29f19a88b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/components/App.tsx

+ 3 - 0
src/components/App.tsx

@@ -7379,6 +7379,9 @@ class App extends React.Component<AppProps, AppState> {
   private maybeSuggestBindingForAll(
     selectedElements: NonDeleted<ExcalidrawElement>[],
   ): void {
+    if (selectedElements.length > 50) {
+      return;
+    }
     const suggestedBindings = getEligibleElementsForBinding(selectedElements);
     this.setState({ suggestedBindings });
   }