Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong typing of getPopupContainer #245

Open
zaycker opened this issue Mar 9, 2021 · 0 comments
Open

Wrong typing of getPopupContainer #245

zaycker opened this issue Mar 9, 2021 · 0 comments

Comments

@zaycker
Copy link

zaycker commented Mar 9, 2021

By reviewing attachParent method:

trigger/src/index.tsx

Lines 572 to 590 in 89eefdb

mountNode = getPopupContainer(domNode);
}
if (mountNode) {
mountNode.appendChild(popupContainer);
} else {
// Retry after frame render in case parent not ready
this.attachId = raf(() => {
this.attachParent(popupContainer);
});
}
};
getContainer = () => {
const { getDocument } = this.props;
const popupContainer = getDocument(this.getRootDomNode()).createElement(
'div',
);
// Make sure default popup container will never cause scrollbar appearing

that means getPopupContainer is able to return falsy value exactly "in case parent not ready". but it is blocked by strict typings:

getPopupContainer?: (node: HTMLElement) => HTMLElement;

may I create PR? actually it is also existent in Tooltip where I came from initially...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant