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

This commit is contained in:
Rahul
2023-08-14 13:11:08 +02:00
committed by GitHub
parent 2b14a5c233
commit c29f19a88b
+3
View File
@@ -7379,6 +7379,9 @@ class App extends React.Component<AppProps, AppState> {
private maybeSuggestBindingForAll( private maybeSuggestBindingForAll(
selectedElements: NonDeleted<ExcalidrawElement>[], selectedElements: NonDeleted<ExcalidrawElement>[],
): void { ): void {
if (selectedElements.length > 50) {
return;
}
const suggestedBindings = getEligibleElementsForBinding(selectedElements); const suggestedBindings = getEligibleElementsForBinding(selectedElements);
this.setState({ suggestedBindings }); this.setState({ suggestedBindings });
} }