Skip to content

Commit

Permalink
Remove isResizing state
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 committed Oct 20, 2023
1 parent 8ec3784 commit ec54472
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/HeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default function HeaderCell<R, SR>({
direction,
dragDropKey
}: HeaderCellProps<R, SR>) {
const [isResizing, setIsResizing] = useState(false);
const [isDragging, setIsDragging] = useState(false);
const [isOver, setIsOver] = useState(false);
const isRtl = direction === 'rtl';
Expand Down Expand Up @@ -119,9 +118,6 @@ export default function HeaderCell<R, SR>({
// prevents scrolling in FF
event.preventDefault();

if (draggable) {
setIsResizing(true);
}
const { currentTarget, pointerId } = event;
const headerCell = currentTarget.parentElement!;
const { right, left } = headerCell.getBoundingClientRect();
Expand All @@ -136,9 +132,6 @@ export default function HeaderCell<R, SR>({
}

function onLostPointerCapture() {
if (draggable) {
setIsResizing(false);
}
currentTarget.removeEventListener('pointermove', onPointerMove);
currentTarget.removeEventListener('lostpointercapture', onLostPointerCapture);
}
Expand Down Expand Up @@ -253,7 +246,7 @@ export default function HeaderCell<R, SR>({
}

let draggableProps: React.HTMLAttributes<HTMLDivElement> | undefined;
if (draggable && !isResizing) {
if (draggable) {
draggableProps = {
draggable: true,
/* events fired on the draggable target */
Expand Down

0 comments on commit ec54472

Please sign in to comment.