fix: voice drop zone was swallowing channel reorder drops

handleVoiceDropZoneDrop called stopPropagation and clearState
unconditionally, preventing container's handleContainerDrop from
firing when dropping a channel onto a voice channel. Add early
return for non-voiceUser drags so channel/category drops bubble
through to the container handler correctly.
This commit is contained in:
Jannis Braun
2026-03-20 21:15:13 +01:00
parent 99e6f2f249
commit 9fe46ad19b
+3 -1
View File
@@ -180,9 +180,11 @@ export function useDragManager(opts: UseDragManagerOpts) {
}, [activeDrag]); }, [activeDrag]);
const handleVoiceDropZoneDrop = useCallback((e: React.DragEvent, channelId: string) => { const handleVoiceDropZoneDrop = useCallback((e: React.DragEvent, channelId: string) => {
// Only handle voice user drops — let channel/category drops bubble to container
if (activeDrag?.type !== 'voiceUser') return;
e.preventDefault(); e.preventDefault();
e.stopPropagation(); // Prevent bubbling to container's onDrop e.stopPropagation(); // Prevent bubbling to container's onDrop
if (activeDrag?.type === 'voiceUser' && activeDrag.sourceId && activeDrag.sourceId !== channelId) { if (activeDrag.sourceId && activeDrag.sourceId !== channelId) {
onVoiceUserDrop(activeDrag.dragId, activeDrag.sourceId, channelId); onVoiceUserDrop(activeDrag.dragId, activeDrag.sourceId, channelId);
} }
clearState(); clearState();