react-konva-grid
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -519,13 +519,13 @@ "use strict"; | ||
document.addEventListener("mouseup", handleFillHandleMouseUp); | ||
}, [activeCell, selections]); | ||
}, [selections]); | ||
const handleFillHandleMouseMove = react_1.useCallback((e) => { | ||
/* Exit if user is not in selection mode */ | ||
if (!isFilling.current || !gridRef || !activeCell) | ||
if (!isFilling.current || !gridRef || !activeCellRef.current) | ||
return; | ||
const coords = gridRef.current.getCellCoordsFromOffset(e.clientX, e.clientY); | ||
const bounds = selectionFromStartEnd(activeCell, coords); | ||
const bounds = selectionFromStartEnd(activeCellRef.current, coords); | ||
const hasSelections = selections.length > 0; | ||
const activeCellBounds = hasSelections | ||
? selections[0].bounds | ||
: gridRef.current.getCellBounds(activeCell); | ||
? selections[selections.length - 1].bounds | ||
: gridRef.current.getCellBounds(activeCellRef.current); | ||
if (!bounds) | ||
@@ -555,3 +555,3 @@ return; | ||
gridRef.current.scrollToItem(coords); | ||
}, [activeCell, selections]); | ||
}, [selections]); | ||
const handleFillHandleMouseUp = react_1.useCallback((e) => { | ||
@@ -563,3 +563,3 @@ isFilling.current = false; | ||
/* Exit early */ | ||
if (!gridRef) | ||
if (!gridRef || !activeCellRef.current) | ||
return; | ||
@@ -575,6 +575,6 @@ /* Update last selection */ | ||
return; | ||
onFill && onFill(activeCell, fillSelection, selections); | ||
onFill && onFill(activeCellRef.current, fillSelection, selections); | ||
/* Modify last selection */ | ||
modifySelection(coords); | ||
}, [activeCell, selections]); | ||
}, [selections]); | ||
return { | ||
@@ -581,0 +581,0 @@ activeCell, |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -710,3 +710,3 @@ import React, { useState, useCallback, useRef, useEffect } from "react"; | ||
}, | ||
[activeCell, selections] | ||
[selections] | ||
); | ||
@@ -717,3 +717,3 @@ | ||
/* Exit if user is not in selection mode */ | ||
if (!isFilling.current || !gridRef || !activeCell) return; | ||
if (!isFilling.current || !gridRef || !activeCellRef.current) return; | ||
@@ -724,7 +724,7 @@ const coords = gridRef.current.getCellCoordsFromOffset( | ||
); | ||
const bounds = selectionFromStartEnd(activeCell, coords); | ||
const bounds = selectionFromStartEnd(activeCellRef.current, coords); | ||
const hasSelections = selections.length > 0; | ||
const activeCellBounds = hasSelections | ||
? selections[0].bounds | ||
: gridRef.current.getCellBounds(activeCell); | ||
? selections[selections.length - 1].bounds | ||
: gridRef.current.getCellBounds(activeCellRef.current); | ||
if (!bounds) return; | ||
@@ -760,3 +760,3 @@ | ||
}, | ||
[activeCell, selections] | ||
[selections] | ||
); | ||
@@ -772,3 +772,3 @@ | ||
/* Exit early */ | ||
if (!gridRef) return; | ||
if (!gridRef || !activeCellRef.current) return; | ||
@@ -790,3 +790,3 @@ /* Update last selection */ | ||
onFill && onFill(activeCell, fillSelection, selections); | ||
onFill && onFill(activeCellRef.current, fillSelection, selections); | ||
@@ -796,3 +796,3 @@ /* Modify last selection */ | ||
}, | ||
[activeCell, selections] | ||
[selections] | ||
); | ||
@@ -799,0 +799,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395308