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:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user