refactor: refactor popper

This commit is contained in:
QiShaoXuan
2022-08-12 18:49:47 +08:00
parent 82c3d773d6
commit f16bfecab8
8 changed files with 188 additions and 205 deletions
@@ -23,7 +23,7 @@ export const CommandPanel = ({ app }: { app: TldrawApp }) => {
? app.getScreenPoint([bounds.minX, bounds.minY])
: undefined;
const anchor = getAnchor({
const anchorEl = getAnchor({
x: point?.[0] || 0,
y: (point?.[1] || 0) + 40,
width: bounds?.width ? bounds.width * camera.zoom : 0,
@@ -101,7 +101,7 @@ export const CommandPanel = ({ app }: { app: TldrawApp }) => {
<Popover
trigger="click"
visible={!!point}
anchor={anchor}
anchorEl={anchorEl}
popoverDirection="none"
content={
<PopoverContainer>