question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Menu not showing up when app is on fullscreen

See original GitHub issue

I’m using react-full-screen to provide fullscreen functionality to my project. Noticed that, when on fullscreen mode, a Menu component I’m showing up on a button click won’t show up. My Menu looks something like this:

 <Menu anchorEl={anchorEl} open={isOpen} onClose={handleClose}>
    <MenuItem onClick={() => handleMenuClick('general')}>General</MenuItem>
    <MenuItem onClick={() => handleMenuClick('appearance')}>
      Appearance
    </MenuItem>
    <MenuItem onClick={() => handleMenuClick('sound')}>Sound</MenuItem>
  </Menu>

If I inspect the DOM I can see the

    element there, is just that it won’t show up on the screen. Tried changing the z-index and position properties but didn’t work. Any idea?

    • This is not a v0.x issue.
    • I have searched the issues of this repository and believe that this is not a duplicate.

    Expected Behavior 🤔

    Menu should show up when on fullscreen mode.

    Current Behavior 😯

    Not showing up.

    Steps to Reproduce 🕹

    1. Install react-full-screen
    2. Implement a < Menu >
    3. Try to open it on fullscreen mode. Link: CodeSandbox Page to test fullscreen

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
bthall16commented, Mar 8, 2022

I found theme composition/default props to work well for me here:

function container() {
  // Use the fullscreen element if in fullscreen mode, otherwise just the document's body
  return document.fullscreenElement ?? document.body;
}

// For my use case I needed menus and tooltips to be visible while in fullscreen mode
const fullscreenTheme = createTheme({
  components: {
    MuiMenu: {
      defaultProps: {
        container,
      },
    },
    MuiTooltip: {
      defaultProps: {
        PopperProps: {
          container,
        },
      },
    },
  },
});

...

<SomeComponentThatCouldBeFullscreen>
  {/* Ensures the custom container function only applies to menus and tooltips 
      within the fullscreen element */}
  <ThemeProvider theme={fullscreenTheme}>
    ...
  </ThemeProvider>
</SomeComponentThatCouldBeFullscreen>

Admittedly I came up with this fairly quickly but it appears to be working well for me.

4reactions
joncursicommented, Oct 31, 2019

Update: I was able to mostly solve this by using the container prop on the Popover component. This will prevent pop over components from being appended to document.body and instead append them to the container element specified.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Menu bar does NOT appear in FULLSCREEN APPS
I experience the same problem, but I found a workaround by using command key "Ctrl + F2" or "Ctrl + F8". It then...
Read more >
Menu not showing up when app is on fullscreen · Issue #15618
I'm using react-full-screen to provide fullscreen functionality to my project. Noticed that, when on fullscreen mode, a Menu component I'm ...
Read more >
How to Make Your Mac's Menu Bar Stay Visible in Full Screen ...
in the dropdown menu. Click the Dock & Menu Bar icon in the preference pane. Make sure Dock & Menu Bar is selected...
Read more >
11 Ways to Fix the Windows Taskbar Showing in Fullscreen
1. Try Minimizing or Maximizing the Apps ... Click on the app icon in the taskbar which still displays the bar while in...
Read more >
Missing apps in full-screen display setting - XDA Forums
Go to app info from the launcher or recents screen (hold the top bar of the app for a second till you see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found