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 ( return (
<button <button
data-testid="new-page-button"
style={style} style={style}
className={clsx([styles.root, className])} className={clsx([styles.root, className])}
onClick={() => { onClick={() => {

View File

@@ -15,3 +15,9 @@ globalStyle('html', {
globalStyle('html[data-theme="dark"]', { globalStyle('html[data-theme="dark"]', {
vars: darkCssVariables, 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 ( return (
<ClickAwayListener <ClickAwayListener
onClickAway={() => { onClickAway={() => {
@@ -122,9 +126,11 @@ export const Popper = ({
}, },
onPointerEnter: onPointerEnterHandler, onPointerEnter: onPointerEnterHandler,
onPointerLeave: onPointerLeaveHandler, onPointerLeave: onPointerLeaveHandler,
className: `${anchorClassName ? anchorClassName + ' ' : ''}${ ...(mergedClass
children.props.className ? {
}`, className: mergedClass,
}
: {}),
})} })}
{content && ( {content && (
<BasicStyledPopper <BasicStyledPopper