Skip to content

Commit

Permalink
removing memoizing order
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Feb 19, 2021
1 parent 8c6e429 commit 673019b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ export function DraggableDimensionButton({
columnId,
]);

/* 2 to leave room for data panel and workspace, then go by layer index, then by group index */
const order = useMemo(() => [2, layerIndex, groupIndex, accessorIndex], [
layerIndex,
groupIndex,
accessorIndex,
]);

const handleOnDrop = React.useCallback(
(droppedItem, selectedDropType) => onDrop(droppedItem, value, selectedDropType),
[value, onDrop]
Expand All @@ -128,7 +121,7 @@ export function DraggableDimensionButton({
<DragDrop
getAdditionalClassesOnEnter={getAdditionalClassesOnEnter}
getAdditionalClassesOnDroppable={getAdditionalClassesOnDroppable}
order={order}
order={[2, layerIndex, groupIndex, accessorIndex]}
draggable
dragType={isDraggedOperation(dragging) ? 'move' : 'copy'}
dropType={dropType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ export function EmptyDimensionButton({
[dropType, newColumnId, group.groupId, layerId, group.groupLabel, itemIndex, nextLabel]
);

/* 2 to leave room for data panel and workspace, then go by layer index, then by group index */
const order = useMemo(() => [2, layerIndex, groupIndex, itemIndex], [
layerIndex,
groupIndex,
itemIndex,
]);

const handleOnDrop = React.useCallback(
(droppedItem, selectedDropType) => onDrop(droppedItem, value, selectedDropType),
[value, onDrop]
Expand All @@ -102,7 +95,7 @@ export function EmptyDimensionButton({
<DragDrop
getAdditionalClassesOnDroppable={getAdditionalClassesOnDroppable}
value={value}
order={order}
order={[2, layerIndex, groupIndex, itemIndex]}
onDrop={handleOnDrop}
dropType={dropType}
>
Expand Down

0 comments on commit 673019b

Please sign in to comment.