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

Custom menu doesn't collapse #6630

Closed
mvanderblom opened this issue Sep 29, 2021 · 9 comments · Fixed by #6635
Closed

Custom menu doesn't collapse #6630

mvanderblom opened this issue Sep 29, 2021 · 9 comments · Fixed by #6635
Labels

Comments

@mvanderblom
Copy link

mvanderblom commented Sep 29, 2021

I'm trying to add a custom menu following the documentation here: https://marmelab.com/react-admin/Theming.html#using-a-custom-menu. The menu gets displayed ok but when it is collapsed, the text stays visible behind the main content

Open menu:
image

Closed menu with text visible behind main content:
image

Codesandbox example:
https://codesandbox.io/s/youthful-fog-h607k?file=/src/App.js

I would expect the collapsing of the menu to be handled by the MenuItemLink component as described here: https://marmelab.com/react-admin/Buttons.html#menuitemlink

I'm not sure what causes the current beahviour

@djhi djhi added the bug label Sep 29, 2021
@djhi
Copy link
Collaborator

djhi commented Sep 30, 2021

Indeed, thanks for the report. It seems that #6534 introduced this breaking change

@WiXSL
Copy link
Contributor

WiXSL commented Sep 30, 2021

Duplicate of #6591?

@djhi djhi mentioned this issue Sep 30, 2021
@djhi
Copy link
Collaborator

djhi commented Sep 30, 2021

No, that's not the same issue

@mvanderblom
Copy link
Author

Thanks for the quick reply and fix!

@windman007
Copy link

windman007 commented Oct 11, 2021

Still have the same problem on 3.18.3. Some global styles helped for me.
.RaSidebar-fixed-34 { position: inherit !important; width: 100%; }

@felipejh
Copy link

Still have the same problema on 3.18.3.
I needed to overwrite the global theme:

RaSidebar: {
      fixed: {
        position: 'inherit'
      }
    }

@mrclayman
Copy link

Also got this problem on 3.18.3, sadly. @felipejh , sorry for the noobish question -- how do I apply this globally? I already have a simple global theme to adjust the main colors, which I pass to the Admin component, but simply adding the snippet you posted does not seem to cut it for me.

TIA.

@felipejh
Copy link

@mrclayman

I will try to exemplify:

1- CustomMuiTheme.tsx

const theme: RaThemeOptions = {
   overrides: {
      RaSidebar: {
         fixed: {
           position: 'inherit'
         }
       }
   }
}

export { theme } 

2- CustomLayout.tsx

import { theme } ...

<Layout theme={theme}/>

3- App.tsx

<Admin 
   layout={CustomLayout}
/>

@mrclayman
Copy link

mrclayman commented Oct 15, 2021

Thanks for the swift response, @felipejh . 👍 It turns out, I was halfway there. I just needed to nest the RaSidebar object inside overrides.

Cheers! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants