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

[Menu] Fix proptypes #25694

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 10 additions & 1 deletion packages/material-ui/src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import MenuList from '../MenuList';
import Paper from '../Paper';
import Popover from '../Popover';
import experimentalStyled, { shouldForwardProp } from '../styles/experimentalStyled';
import useTheme from '../styles/useTheme';
import useThemeProps from '../styles/useThemeProps';
import setRef from '../utils/setRef';
import menuClasses, { getMenuUtilityClass } from './menuClasses';
Expand Down Expand Up @@ -83,7 +84,7 @@ const MenuMenuList = experimentalStyled(
});

const Menu = React.forwardRef(function Menu(inProps, ref) {
const { isRtl, theme, ...props } = useThemeProps({ props: inProps, name: 'MuiMenu' });
const props = useThemeProps({ props: inProps, name: 'MuiMenu' });

const {
autoFocus = true,
Expand All @@ -101,6 +102,10 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {
...other
} = props;

// use the `isRtl` from the props after the buildAPI script support it
const theme = useTheme();
const isRtl = theme.direction === 'rtl';

const styleProps = {
...props,
autoFocus,
Expand Down Expand Up @@ -278,6 +283,10 @@ Menu.propTypes /* remove-proptypes */ = {
* If `true`, the component is shown.
*/
open: PropTypes.bool.isRequired,
/**
* @ignore
*/
PaperProps: PropTypes.object,
/**
* `classes` prop applied to the [`Popover`](/api/popover/) element.
*/
Expand Down