Change default WindowPosition from center to top_left

This commit is contained in:
Mattia Del Franco 2023-01-06 12:30:31 +01:00 committed by GitHub
parent 568e7bc002
commit 1ac157637c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ export interface DraggableWindowProps
export const DraggableWindow: FC<DraggableWindowProps> = props =>
{
const { uniqueKey = null, handleSelector = '.drag-handler', windowPosition = DraggableWindowPosition.CENTER, disableDrag = false, dragStyle = {}, children = null, offsetLeft = 0, offsetTop = 0 } = props;
const { uniqueKey = null, handleSelector = '.drag-handler', windowPosition = DraggableWindowPosition.TOP_LEFT, disableDrag = false, dragStyle = {}, children = null, offsetLeft = 0, offsetTop = 0 } = props;
const [ delta, setDelta ] = useState<{ x: number, y: number }>(null);
const [ offset, setOffset ] = useState<{ x: number, y: number }>(null);
const [ start, setStart ] = useState<{ x: number, y: number }>({ x: 0, y: 0 });