Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

prevent hover effect on sidebar collection list when dragging over

Kha Nguyen652931e5be0c
diff --git a/apps/web/components/CollectionListing.tsx b/apps/web/components/CollectionListing.tsx
index 730a1ae9..73c7930a 100644
--- a/apps/web/components/CollectionListing.tsx
+++ b/apps/web/components/CollectionListing.tsx
@@ -23,6 +23,7 @@ import { useUpdateUser, useUser } from "@linkwarden/router/user";
import Icon from "./Icon";
import { IconWeight } from "@phosphor-icons/react";
import Droppable from "./Droppable";
+import { cn } from "@linkwarden/lib";
interface ExtendedTreeItem extends TreeItem {
data: Collection;
@@ -303,6 +304,7 @@ const renderItem = (
collectionId: collection.id,
ownerId: collection.ownerId,
}}
+ className="group"
>
<div
ref={provided.innerRef}
@@ -310,11 +312,12 @@ const renderItem = (
className="mb-1"
>
<div
- className={`${
+ className={cn(
currentPath === `/collections/${collection.id}`
? "bg-primary/20 is-active"
- : "hover:bg-neutral/20"
- } duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md`}
+ : "group-[&:not([data-over])]:hover:bg-neutral/20",
+ "duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md"
+ )}
>
{Dropdown(item as ExtendedTreeItem, onExpand, onCollapse)}
diff --git a/apps/web/components/Droppable.tsx b/apps/web/components/Droppable.tsx
index b10c249e..d7e928d7 100644
--- a/apps/web/components/Droppable.tsx
+++ b/apps/web/components/Droppable.tsx
@@ -21,6 +21,7 @@ const Droppable = ({
data,
});
+ const extraProps = isOver ? { "data-over": "" } : {};
return (
<div
ref={setNodeRef}
@@ -30,6 +31,7 @@ const Droppable = ({
"transition-colors duration-200",
className
)}
+ {...extraProps}
style={{
position: "relative",
zIndex: isOver ? 1 : "auto",