X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/1cc633c7a6ad9609424580973da06c92839489e2..d86374acae51a7706b55c1333491f297df173a0a:/src/components/popover/helpers.ts diff --git a/src/components/popover/helpers.ts b/src/components/popover/helpers.ts index 13f74a68..ac860ac0 100644 --- a/src/components/popover/helpers.ts +++ b/src/components/popover/helpers.ts @@ -4,13 +4,16 @@ import { PopoverOrigin } from "@material-ui/core/Popover"; -export const mockAnchorFromMouseEvent = (event: React.MouseEvent) => { +export const createAnchorAt = (position: {x: number, y: number}) => { const el = document.createElement('div'); - const clientRect = { - left: event.clientX, - right: event.clientX, - top: event.clientY, - bottom: event.clientY, + const clientRect: DOMRect = { + x: position.x, + y: position.y, + toJSON: () => '', + left: position.x, + right: position.x, + top: position.y, + bottom: position.y, width: 0, height: 0 };