소스 검색

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

Rahul 2 년 전
부모
커밋
c29f19a88b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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 });
   }