Set all popovers withinPortal by default

This commit is contained in:
jeffvli
2022-11-03 14:41:34 -07:00
parent 53a7d728b3
commit 5908554f38
4 changed files with 11 additions and 4 deletions
@@ -12,7 +12,7 @@ interface DatePickerProps extends MantineDatePickerProps {
const StyledDatePicker = styled(MantineDatePicker)<DatePickerProps>``;
export const DatePicker = ({ width, maxWidth, ...props }: DatePickerProps) => {
return <StyledDatePicker {...props} sx={{ maxWidth, width }} />;
return <StyledDatePicker withinPortal {...props} sx={{ maxWidth, width }} />;
};
DatePicker.defaultProps = {
@@ -45,7 +45,11 @@ const StyledMenuDivider = styled(MantineMenu.Divider)`
`;
export const DropdownMenu = ({ children, ...props }: MenuProps) => {
return <StyledMenu {...props}>{children}</StyledMenu>;
return (
<StyledMenu withinPortal {...props}>
{children}
</StyledMenu>
);
};
const MenuLabel = ({ children, ...props }: MenuLabelProps) => {
+4 -2
View File
@@ -5,15 +5,17 @@ import {
} from '@mantine/core';
interface SelectProps extends MantineSelectProps {
maxWidth?: number | string;
width?: number | string;
}
const StyledSelect = styled(MantineSelect)``;
export const Select = ({ width, ...props }: SelectProps) => {
return <StyledSelect {...props} sx={{ width }} />;
export const Select = ({ width, maxWidth, ...props }: SelectProps) => {
return <StyledSelect withinPortal {...props} sx={{ maxWidth, width }} />;
};
Select.defaultProps = {
maxWidth: undefined,
width: undefined,
};
@@ -10,6 +10,7 @@ const StyledTooltip = styled(MantineTooltip)`
export const Tooltip = ({ children, ...rest }: TooltipProps) => {
return (
<StyledTooltip
withinPortal
pl={10}
pr={10}
py={5}