Skip to content

Commit

Permalink
✏️ fix: types fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ONLY-yours committed Jul 11, 2024
1 parent 6505684 commit 217c0d9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/DraggablePanel/FloatMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Enable, NumberSize, Size } from 're-resizable';
import { HandleClassName } from 're-resizable';
import type { CSSProperties, FC, ReactNode } from 'react';
import { memo, useMemo } from 'react';
import type { Position, Props as RndProps } from 'react-rnd';
import type { Position, Props, Props as RndProps } from 'react-rnd';
import { Rnd } from 'react-rnd';

import { useStyle } from './style';
Expand Down Expand Up @@ -155,18 +155,20 @@ export const FloatMode: FC<FloatProps> = memo(
maxHeight: maxHeight ? Math.max(maxHeight, 0) : undefined,
maxWidth: maxWidth ? Math.max(maxWidth, 0) : undefined,
defaultSize,
size: size as Size,
size: size as Props[`size`],
style,
};

return (
<Rnd
position={position}
resizeHandleClasses={resizeHandleClassNames}
default={{
...defaultPosition,
...defaultSize,
}}
default={
{
...defaultPosition,
...defaultSize,
} as Props[`default`]
}
onDragStop={(e, data) => {
onPositionChange?.({ x: data.x, y: data.y });
}}
Expand Down

0 comments on commit 217c0d9

Please sign in to comment.