fix: unexpected undefined class in popup (#2394)

This commit is contained in:
Whitewater
2023-05-16 03:01:27 -07:00
committed by LongYinan
parent c0d6b8c458
commit 943e6c59e3
3 changed files with 15 additions and 4 deletions
+9 -3
View File
@@ -97,6 +97,10 @@ export const Popper = ({
};
});
const mergedClass = [anchorClassName, children.props.className]
.filter(Boolean)
.join(' ');
return (
<ClickAwayListener
onClickAway={() => {
@@ -122,9 +126,11 @@ export const Popper = ({
},
onPointerEnter: onPointerEnterHandler,
onPointerLeave: onPointerLeaveHandler,
className: `${anchorClassName ? anchorClassName + ' ' : ''}${
children.props.className
}`,
...(mergedClass
? {
className: mergedClass,
}
: {}),
})}
{content && (
<BasicStyledPopper