support playlist sidebar drag to queue

This commit is contained in:
jeffvli
2025-11-29 13:24:58 -08:00
parent 5e12a666e3
commit 2fa6c9de94
2 changed files with 60 additions and 4 deletions
@@ -15,6 +15,11 @@ export const SidebarItem = ({ children, className, to, ...props }: SidebarItemPr
const toPath = typeof to === 'string' ? to : to.pathname || '';
const isActive = location.pathname === toPath;
const handleLinkDragStart = (e: React.DragEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
};
return (
<Button
className={clsx(
@@ -31,6 +36,8 @@ export const SidebarItem = ({ children, className, to, ...props }: SidebarItemPr
label: styles.label,
}}
component={Link}
draggable={false}
onDragStart={handleLinkDragStart}
to={to}
variant="subtle"
{...props}