fix: popper ignores the children onClick event

This commit is contained in:
QiShaoXuan 2022-11-10 10:47:38 +08:00
parent caa80bc857
commit a5a5b56c6e

View File

@ -106,6 +106,7 @@ export const Popper = ({
{cloneElement(children, {
ref: (dom: HTMLDivElement) => setAnchorEl(dom),
onClick: (e: MouseEvent) => {
children.props.onClick?.(e);
if (!hasClickTrigger || visibleControlledByParent) {
// @ts-ignore
onClick?.(e);