Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pistonite/celera",
"version": "0.3.2",
"version": "0.3.3",
"type": "module",
"private": true,
"description": "In-house UI framework",
Expand Down
11 changes: 11 additions & 0 deletions src/components/resize_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export interface ResizeLayoutOwnProps {
* if the device is mobile
*/
touch?: boolean;

/**
* Override the z-index of the resize handles. Use if need to win z-index fights.
* Default z-index is 1000
*/
resizeHandleZIndex?: number;
}

/**
Expand Down Expand Up @@ -115,15 +121,18 @@ export const ResizeLayout: React.FC<PropsWithChildren<ResizeLayoutProps>> = (inP
secondMinHeight,
children,
touch: propTouch,
resizeHandleZIndex: propResizeHandleZIndex,
...props
} = inProps;

const [firstChild, secondChild] = Children.toArray(children);

const styles = useStyles();
const containerRef = useRef<HTMLDivElement>(null);
const firstRef = useRef<HTMLDivElement>(null);
// [startX, startY, startWidth, startHeight]
const [resizing, setResizing] = useState<number[] | undefined>(undefined);
const resizeHandleZIndex = resizing ? undefined : (propResizeHandleZIndex ?? 1000);

const touch = propTouch || isMobile();

Expand Down Expand Up @@ -207,6 +216,7 @@ export const ResizeLayout: React.FC<PropsWithChildren<ResizeLayoutProps>> = (inP
{firstChild}
{!disabled && (
<div
style={{ zIndex: resizeHandleZIndex }}
className={mergeClasses(
styles.dragHandle,
styles.dragHandleFirst,
Expand All @@ -229,6 +239,7 @@ export const ResizeLayout: React.FC<PropsWithChildren<ResizeLayoutProps>> = (inP
>
{!disabled && (
<div
style={{ zIndex: resizeHandleZIndex }}
className={mergeClasses(
styles.dragHandle,
styles.dragHandleSecond,
Expand Down
Loading