fix: unexpected undefined class in popup (#2394)

This commit is contained in:
Whitewater
2023-05-16 03:01:27 -07:00
committed by GitHub
parent a0ff520ba4
commit 9ce3a96862
3 changed files with 15 additions and 4 deletions

View File

@@ -15,7 +15,6 @@ export function AppUpdaterButton({ className, style }: AddPageButtonProps) {
return (
<button
data-testid="new-page-button"
style={style}
className={clsx([styles.root, className])}
onClick={() => {

View File

@@ -15,3 +15,9 @@ globalStyle('html', {
globalStyle('html[data-theme="dark"]', {
vars: darkCssVariables,
});
if (process.env.NODE_ENV === 'development') {
globalStyle('.undefined', {
border: '5px solid red !important',
});
}

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