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]);
|
||||
|
||||
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.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);
|
||||
}
|
||||
clearState();
|
||||
|
||||
Reference in New Issue
Block a user