Skip to content

Commit 33387b9

Browse files
committed
chore: address review comments
1 parent 9596a78 commit 33387b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/base/src/util/dragAndDrop/DragAndDropMixin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type UI5Element from "../../UI5Element.js";
2-
import type MovePlacement from "../../types/MovePlacement.js";
2+
import MovePlacement from "../../types/MovePlacement.js";
33
import Orientation from "../../types/Orientation.js";
44
import type { DragAndDropSettings } from "./DragRegistry.js";
55
import DragRegistry from "./DragRegistry.js";
@@ -10,8 +10,8 @@ import { findClosestPosition } from "./findClosestPosition.js";
1010
type DragAndDropCallbacks = {
1111
getItemsForDragDrop: () => Array<HTMLElement>;
1212
getOrientation: () => Orientation;
13-
getDropIndicator: () => { targetReference: HTMLElement | null; placement: any } | null;
14-
setDropIndicator: (targetReference: HTMLElement | null, placement?: any) => void;
13+
getDropIndicator: () => { targetReference: HTMLElement | null; placement: MovePlacement | null } | null;
14+
setDropIndicator: (targetReference: HTMLElement | null, placement?: MovePlacement) => void;
1515
shouldContainsDraggedElement?: (draggedElement: HTMLElement, targetElement: HTMLElement) => boolean;
1616
getDragAndDropSettings?: () => DragAndDropSettings;
1717
getTargetFromPosition?: (element: HTMLElement) => HTMLElement;
@@ -75,13 +75,13 @@ function createDragAndDropMixin<T extends UI5Element>(callbacks: DragAndDropCall
7575

7676
// Filter out "On" placement if dropping on the dragged element itself
7777
if (closestPosition.element === draggedElement) {
78-
closestPosition.placements = closestPosition.placements.filter(placement => placement !== "On" as MovePlacement);
78+
closestPosition.placements = closestPosition.placements.filter(placement => placement !== MovePlacement.On);
7979
}
8080

8181
const settings = callbacks.getDragAndDropSettings?.() || {};
8282
const { targetReference, placement } = handleDragOver(e, this, closestPosition, closestPosition.element, settings);
8383

84-
callbacks.setDropIndicator(targetReference, placement);
84+
callbacks.setDropIndicator(targetReference, placement as MovePlacement);
8585
},
8686

8787
_ondrop(this: T, e: DragEvent) {

0 commit comments

Comments
 (0)