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] Having multiple menuItems adds inline width to MenuList #7266

Closed
sairamdevarashetty opened this issue Jun 27, 2017 · 5 comments
Closed
Labels
bug 🐛 Something doesn't work component: menu This is the name of the generic UI component, not the React module!

Comments

@sairamdevarashetty
Copy link

sairamdevarashetty commented Jun 27, 2017

I have found the following code in menulist.js, can I know why it exists ?

if (list && element.clientHeight < list.clientHeight) {
        var size = (0, _scrollbarSize2.default)() + 'px';
        // $FlowFixMe
        list.style.paddingRight = size;
        // $FlowFixMe
        list.style.width = 'calc(100% + ' + size + ')';
      }
@sairamdevarashetty
Copy link
Author

sairamdevarashetty commented Jun 27, 2017

Before :

goin 4

After :
goin 5

@oliviertassinari
Copy link
Member

This piece of logic is here in order to handle scroll bar positioning issue. However, I'm wondering if that's really needed. Have you tried commenting the logic?

@oliviertassinari oliviertassinari changed the title having multiple menuItems adds inline width to MenuList [Menu] Having multiple menuItems adds inline width to MenuList Jun 27, 2017
@oliviertassinari oliviertassinari added component: menu This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels Jun 27, 2017
@sairamdevarashetty
Copy link
Author

I just did and the width is full as supposed to be ,

After Commenting the code :

goin 6

@sairamdevarashetty
Copy link
Author

sairamdevarashetty commented Jun 28, 2017

but for now I just added the following code to fix it

                           <Menu
	                        id="choose-mobility-name"
	                        anchorEl={this.state.anchorEl}
	                        open={this.state.openMenu}
	                        style={{
	                        	maxHeight:"inherit"
	                        }}
			        		MenuListProps={{
	                            style:{
	                              width: this.state.widthOfMenuItem
	                            },
	                            className:"sairam",
	                        }}
	                    >

@oliviertassinari
Copy link
Member

I have changed the behavior. Now the user style takes precedence over the internal scroll logic handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

2 participants