Skip to content

Commit

Permalink
[Select] Fix PopoverClasses being overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorfrs-dev committed Dec 8, 2022
1 parent 39f5143 commit 7ff5c08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mui-material/src/Menu/Menu.js
Expand Up @@ -158,7 +158,6 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {

return (
<MenuRoot
classes={PopoverClasses}
onClose={onClose}
anchorOrigin={{
vertical: 'bottom',
Expand All @@ -180,6 +179,7 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {
TransitionProps={{ onEntering: handleEntering, ...TransitionProps }}
ownerState={ownerState}
{...other}
classes={PopoverClasses}
>
<MenuMenuList
onKeyDown={handleListKeyDown}
Expand Down
13 changes: 13 additions & 0 deletions packages/mui-material/src/Menu/Menu.test.js
Expand Up @@ -111,6 +111,19 @@ describe('<Menu />', () => {

expect(screen.getByTestId('paper')).to.have.class('bar');
});

it('should be able to change the root element style', () => {
render(
<Menu
anchorEl={document.createElement('div')}
open
PaperProps={{ 'data-testid': 'paper' }}
PopoverClasses={{ root: 'foo' }}
/>,
);

expect(screen.getByTestId('paper').parentElement).to.have.class('foo');
});
});

it('should pass onClose prop to Popover', () => {
Expand Down

0 comments on commit 7ff5c08

Please sign in to comment.