Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InlineWrapper]: Don't force any width on the paper #1248

Merged
merged 1 commit into from
Aug 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions lib/src/wrappers/InlineWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import Popover, { PopoverProps as PopoverPropsType } from '@material-ui/core/Popover';
import { WrapperProps } from './Wrapper';
import { makeStyles } from '@material-ui/core/styles';
import { useKeyDown } from '../_shared/hooks/useKeyDown';
import { TextFieldProps } from '@material-ui/core/TextField';
import { DIALOG_WIDTH, DIALOG_WIDTH_WIDER } from '../constants/dimensions';

export const useStyles = makeStyles(
{
popoverPaper: {
width: DIALOG_WIDTH,
paddingBottom: 8,
},
popoverPaperWider: {
width: DIALOG_WIDTH_WIDER,
},
},
{ name: 'MuiPickersInlineWrapper' }
);

export interface InlineWrapperProps<T = TextFieldProps> extends WrapperProps<T> {
/** Popover props passed to material-ui Popover (with variant="inline") */
Expand All @@ -41,7 +25,6 @@ export const InlineWrapper: React.FC<InlineWrapperProps> = ({
...other
}) => {
const ref = React.useRef();
const classes = useStyles();

useKeyDown(open, {
Enter: onAccept,
Expand All @@ -55,9 +38,6 @@ export const InlineWrapper: React.FC<InlineWrapperProps> = ({
open={open}
onClose={onDismiss}
anchorEl={ref.current}
classes={{
paper: clsx(classes.popoverPaper, { [classes.popoverPaperWider]: wider }),
}}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'center',
Expand Down