mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-10-29 09:54:23 +01:00
Update PropertiesPopover.tsx
This commit is contained in:
@@ -4,7 +4,7 @@ import React, { type ReactNode } from "react";
|
|||||||
|
|
||||||
import { isInteractive } from "@excalidraw/common";
|
import { isInteractive } from "@excalidraw/common";
|
||||||
|
|
||||||
import { useApp, useDevice } from "./App";
|
import { useDevice } from "./App";
|
||||||
import { Island } from "./Island";
|
import { Island } from "./Island";
|
||||||
|
|
||||||
interface PropertiesPopoverProps {
|
interface PropertiesPopoverProps {
|
||||||
@@ -40,17 +40,14 @@ export const PropertiesPopover = React.forwardRef<
|
|||||||
ref,
|
ref,
|
||||||
) => {
|
) => {
|
||||||
const device = useDevice();
|
const device = useDevice();
|
||||||
const app = useApp();
|
|
||||||
const { offsetTop, offsetLeft } = app.state;
|
|
||||||
|
|
||||||
const collisionPadding = container
|
const collisionPadding = container
|
||||||
? (() => {
|
? (() => {
|
||||||
const rect = container.getBoundingClientRect();
|
const rect = container.getBoundingClientRect();
|
||||||
return {
|
return {
|
||||||
top: Math.max(8, rect.top),
|
top: 8,
|
||||||
right: Math.max(8, window.innerWidth - rect.right - offsetLeft),
|
right: Math.max(8, window.innerWidth - rect.right),
|
||||||
bottom: Math.max(8, window.innerHeight - rect.bottom - offsetTop),
|
bottom: Math.max(8, window.innerHeight - rect.bottom),
|
||||||
left: Math.max(8, rect.left),
|
left: 8,
|
||||||
};
|
};
|
||||||
})()
|
})()
|
||||||
: 8;
|
: 8;
|
||||||
|
|||||||
Reference in New Issue
Block a user