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

Using full screen in Material UI components #44

Closed
haziqali-2019 opened this issue Sep 9, 2020 · 11 comments
Closed

Using full screen in Material UI components #44

haziqali-2019 opened this issue Sep 9, 2020 · 11 comments

Comments

@haziqali-2019
Copy link

HI, I am using material ui. There seems to be some issue with material ui select options such that the options do not show on full screen maybe because the options are rendered outside the container element in the dom. I know this is something related to material ui and not this library but I was wondering if anyone faced this issue and was able to resolve it?

@pomle
Copy link
Contributor

pomle commented Sep 17, 2020

@haziqali-2019 can you share your implementation?

@thalysonalexr
Copy link

i have a same problem :(

@pomle
Copy link
Contributor

pomle commented Sep 21, 2020

@thalysonalexr, please share your solution so someone can help you figure out why the problem exists.

@abayo-luc
Copy link

abayo-luc commented Oct 10, 2020

Change container prop of your popover to point to your full-screen component.
<Menu container={() => document.getElementById('fullscreen-node')}> ....</Menu>

It will append your popover inside your full screen node, instead of the default document.body

@pomle
Copy link
Contributor

pomle commented Oct 20, 2020

@haziqali-2019, @thalysonalexr take a look at @abayo-luc. I think they got it.

Had a similar problem with overflow: hidden and Material UI.

@Vasyl-Hnatyshyn
Copy link

document.getElementById('fullscreen-node')}> .... Hi, I need to do the same but with the Select component and it doesn't support 'container'

@ferceballos
Copy link

<Menu container={() => document.getElementById('fullscreen-node')}> ....</Menu>
It will append your popover inside your full screen node, instead of the default document.body

This seems to work just fine, but I have a bunch of these "popover" Material components in my project.

Is there any way to implement this change in all of the components at once instead of doing it one by one?

@pomle
Copy link
Contributor

pomle commented Dec 9, 2020

@ferceballos, you probably have to update everywhere you use your menu but you could create your own Menu wrapper so you don't have to repeat this code. Not sure that is what you need.

const MyMenu = ({children}) => {
  return (
    <Menu container={() => document.getElementById('fullscreen-node')}>
      {children}
    </Menu>
  );
}

@pomle pomle pinned this issue Dec 9, 2020
@pomle pomle changed the title Using full screen in material ui components Using full screen in Material UI components Dec 9, 2020
@pomle
Copy link
Contributor

pomle commented Feb 4, 2021

This seems to be a known issue with Material UI.
The issue is pinned.
Closing.

@pomle pomle closed this as completed Feb 4, 2021
@AntonOfTheWoods
Copy link

@Vasyl-Hnatyshyn , did you find a way to get this to work? Or is that what @pomle means that this is a "known issue"? I couldn't find any other mention of this anywhere else.

@AntonOfTheWoods
Copy link

If anyone else comes here looking for this, then <Select MenuProps={{ container: ref?.current }} ... /> seems to be one way to achieve this.

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

No branches or pull requests

7 participants