fix(dnd): validate proposed hover destinations
Quality / quality (ubuntu-latest) (push) Failing after 1s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 15:09:08 +05:30
1 parent c1f4f42b21
commit 8bc8fe85c3
5 files changed
+42 -3

No files matched your search

+4 -1
View File
@@ -36,7 +36,10 @@ export function createDndManager(options: DndManagerOptions): DndManager {
const source = event.operation.source as
(typeof event.operation.source & { group?: string | number; index?: number }) | null;
if (!source) return;
const destination = { group: source.group ?? "default", index: source.index ?? 0 };
const target = event.operation.target as
(typeof event.operation.target & { group?: string | number; index?: number }) | null;
if (!target) return;
const destination = { group: target.group ?? "default", index: target.index ?? 0 };
if (options.accept && !options.accept(activeIds, destination)) {
event.preventDefault();
options.announce?.({ type: "invalid", ids: activeIds, location: destination });