From 6fa2fbfbef2698eaeb0e5cf34873ad83d8943672 Mon Sep 17 00:00:00 2001
From: Li Ellis Gallardo
Date: Mon, 30 Jan 2023 16:13:29 -0500
Subject: [PATCH] DisabledFn is added as a props
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 1e0de72..a856b2d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -41,7 +41,7 @@ export default class ReactRectangleSelection extends React.Component {
}
handleMouseDown(e) {
- if (this.props.disabled) return;
+ if (this.props.disabled || (this.props.disabledFn && this.props.disabledFn())) return;
let doubleClick = false;
clearTimeout(this.animationInProgress);
this.animationInProgress = null;