Skip to content

Commit a0c598a

Browse files
samejrericallam
authored andcommitted
Fixes hover behaviour and z-index issues of Resizable
1 parent 96868f8 commit a0c598a

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

apps/webapp/app/components/primitives/Resizable.tsx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ import React from "react";
44
import { PanelGroup, Panel, PanelResizer } from "react-window-splitter";
55
import { cn } from "~/utils/cn";
66

7-
const ResizablePanelGroup = ({ className, snapshot, ...props }: React.ComponentProps<typeof PanelGroup>) => {
8-
return (
9-
<PanelGroup
10-
className={cn(
11-
"flex w-full overflow-hidden data-[panel-group-direction=vertical]:flex-col",
12-
className
13-
)}
14-
autosaveStrategy={props.autosaveId ? "cookie" : undefined}
15-
snapshot={snapshot}
16-
{...props}
17-
/>
18-
);
19-
};
7+
const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof PanelGroup>) => (
8+
<PanelGroup
9+
className={cn(
10+
"flex w-full overflow-hidden data-[panel-group-direction=vertical]:flex-col",
11+
className
12+
)}
13+
autosaveStrategy={props.autosaveId ? "cookie" : undefined}
14+
{...props}
15+
/>
16+
);
2017

2118
const ResizablePanel = Panel;
2219

@@ -30,7 +27,7 @@ const ResizableHandle = ({
3027
<PanelResizer
3128
className={cn(
3229
// Base styles
33-
"group relative isolate flex items-center justify-center focus-custom",
30+
"group relative flex items-center justify-center focus-custom",
3431
// Horizontal orientation (default)
3532
"w-0.75 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",
3633
// Vertical orientation
@@ -45,19 +42,19 @@ const ResizableHandle = ({
4542
{...props}
4643
>
4744
{/* Horizontal orientation line indicator */}
48-
<div className="absolute left-[0.0625rem] top-0 h-full w-px bg-grid-bright transition group-hover:left-0 group-hover:w-0.75 group-hover:bg-indigo-500 group-data-[handle-orientation=vertical]:hidden" />
45+
<div className="absolute left-[0.0625rem] top-0 z-20 h-full w-px bg-grid-bright transition group-hover:left-0 group-hover:w-0.75 group-hover:bg-indigo-500 group-data-[handle-orientation=vertical]:hidden" />
4946
{/* Vertical orientation line indicator */}
50-
<div className="absolute left-0 top-[0.0625rem] hidden h-px w-full bg-grid-bright transition group-hover:top-0 group-hover:h-0.75 group-hover:bg-indigo-500 group-data-[handle-orientation=vertical]:block" />
47+
<div className="absolute left-0 top-[0.0625rem] z-20 hidden h-px w-full bg-grid-bright transition group-hover:top-0 group-hover:h-0.75 group-hover:bg-indigo-500 group-data-[handle-orientation=vertical]:block" />
5148
{withHandle && (
5249
<>
5350
{/* Horizontal orientation dots (vertical arrangement) */}
54-
<div className="relative flex h-5 w-0.75 flex-col items-center justify-center gap-[0.1875rem] bg-background-dimmed transition-opacity group-hover:opacity-0 group-data-[handle-orientation=vertical]:hidden">
51+
<div className="z-10 flex h-5 w-0.75 flex-col items-center justify-center gap-[0.1875rem] bg-background-dimmed group-hover:hidden group-data-[handle-orientation=vertical]:hidden">
5552
{Array.from({ length: 3 }).map((_, index) => (
5653
<div key={index} className="h-[0.1875rem] w-0.75 rounded-full bg-charcoal-600" />
5754
))}
5855
</div>
5956
{/* Vertical orientation dots (horizontal arrangement) */}
60-
<div className="relative hidden h-0.75 w-5 flex-row items-center justify-center gap-[0.1875rem] bg-background-dimmed transition-opacity group-hover:opacity-0 group-data-[handle-orientation=vertical]:flex">
57+
<div className="z-10 hidden h-0.75 w-5 flex-row items-center justify-center gap-[0.1875rem] bg-background-dimmed group-hover:hidden group-data-[handle-orientation=vertical]:flex">
6158
{Array.from({ length: 3 }).map((_, index) => (
6259
<div key={index} className="h-0.75 w-[0.1875rem] rounded-full bg-charcoal-600" />
6360
))}

0 commit comments

Comments
 (0)