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

This commit is contained in:
Rahul 2023-08-14 16:41:08 +05:30 committed by GitHub
parent 2b14a5c233
commit c29f19a88b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 });
}