refactor: refactor popper

This commit is contained in:
QiShaoXuan committed 2022-08-12 18:49:47 +08:00
1 parent 82c3d773d6
commit f16bfecab8
8 files changed
+188 -205

No files matched your search

@@ -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>