projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
20000: Change process cancel button to button style
[arvados-workbench2.git]
/
src
/
components
/
popover
/
helpers.ts
diff --git
a/src/components/popover/helpers.ts
b/src/components/popover/helpers.ts
index 13f74a68254ab193f556d7da4f9b80d6ecba2493..ac860ac08f1bdc823898fbf1e557296e7685a669 100644
(file)
--- a/
src/components/popover/helpers.ts
+++ b/
src/components/popover/helpers.ts
@@
-4,13
+4,16
@@
import { PopoverOrigin } from "@material-ui/core/Popover";
import { PopoverOrigin } from "@material-ui/core/Popover";
-export const
mockAnchorFromMouseEvent = (event: React.MouseEvent<HTMLElement>
) => {
+export const
createAnchorAt = (position: {x: number, y: number}
) => {
const el = document.createElement('div');
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
};
width: 0,
height: 0
};