Improve TS definitions

This commit is contained in:
Michael Telatynski 2021-02-18 15:16:07 +00:00
parent 64974eb3ee
commit 354925c2c8
2 changed files with 3 additions and 3 deletions

View file

@ -390,7 +390,7 @@ export class ContextMenu extends React.PureComponent<IProps, IState> {
}
// Placement method for <ContextMenu /> to position context menu to right of elementRect with chevronOffset
export const toRightOf = (elementRect: DOMRect, chevronOffset = 12) => {
export const toRightOf = (elementRect: Pick<DOMRect, "right" | "top" | "height">, chevronOffset = 12) => {
const left = elementRect.right + window.pageXOffset + 3;
let top = elementRect.top + (elementRect.height / 2) + window.pageYOffset;
top -= chevronOffset + 8; // where 8 is half the height of the chevron