Skip to content

Commit

Permalink
refactor: remove DroppableStrictMode as no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Nov 7, 2023
1 parent 2c97362 commit ddf5f92
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
7 changes: 3 additions & 4 deletions packages/core/components/ComponentList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import DroppableStrictMode from "../DroppableStrictMode";

import { Droppable } from "@hello-pangea/dnd";
import styles from "./styles.module.css";
import getClassNameFactory from "../../lib/get-class-name-factory";
import { Draggable } from "../Draggable";
Expand Down Expand Up @@ -85,7 +84,7 @@ const ComponentList = ({
</div>
)}
<div className={getClassName("content")}>
<DroppableStrictMode
<Droppable
droppableId={`component-list${title ? `:${title}` : ""}`}
isDropDisabled
>
Expand All @@ -112,7 +111,7 @@ const ComponentList = ({
<span style={{ display: "none" }}>{provided.placeholder}</span>
</div>
)}
</DroppableStrictMode>
</Droppable>
</div>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/core/components/DropZone/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CSSProperties, useContext, useEffect, useState } from "react";
import { DraggableComponent } from "../DraggableComponent";
import DroppableStrictMode from "../DroppableStrictMode";
import { Droppable } from "@hello-pangea/dnd";
import { getItem } from "../../lib/get-item";
import { setupZone } from "../../lib/setup-zone";
import { rootDroppableId } from "../../lib/root-droppable-id";
Expand Down Expand Up @@ -150,7 +150,7 @@ function DropZoneEdit({ zone, style }: DropZoneProps) {
hasChildren: content.length > 0,
})}
>
<DroppableStrictMode
<Droppable
droppableId={zoneCompound}
direction={"vertical"}
isDropDisabled={!isEnabled}
Expand Down Expand Up @@ -331,7 +331,7 @@ function DropZoneEdit({ zone, style }: DropZoneProps) {
</div>
);
}}
</DroppableStrictMode>
</Droppable>
</div>
);
}
Expand Down
26 changes: 0 additions & 26 deletions packages/core/components/DroppableStrictMode/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { List, Plus, Trash } from "react-feather";
import { FieldLabelInternal, InputOrGroup, type InputProps } from "../..";
import { IconButton } from "../../../IconButton";
import { reorder, replace } from "../../../../lib";
import DroppableStrictMode from "../../../DroppableStrictMode";
import { Droppable } from "@hello-pangea/dnd";
import { DragDropContext } from "@hello-pangea/dnd";
import { Draggable } from "../../../Draggable";
import { generateId } from "../../../../lib/generate-id";
Expand Down Expand Up @@ -88,7 +88,7 @@ export const ArrayField = ({
}
}}
>
<DroppableStrictMode droppableId="array" isDropDisabled={readOnly}>
<Droppable droppableId="array" isDropDisabled={readOnly}>
{(provided, snapshot) => {
return (
<div
Expand Down Expand Up @@ -228,7 +228,7 @@ export const ArrayField = ({
</div>
);
}}
</DroppableStrictMode>
</Droppable>
</DragDropContext>
</FieldLabelInternal>
);
Expand Down

0 comments on commit ddf5f92

Please sign in to comment.