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

fullWidth not work in RaisedButton when upgrade to 0.15.0 #4226

Closed
scarletsky opened this issue May 10, 2016 · 6 comments · Fixed by #4479
Closed

fullWidth not work in RaisedButton when upgrade to 0.15.0 #4226

scarletsky opened this issue May 10, 2016 · 6 comments · Fixed by #4479
Labels
component: button This is the name of the generic UI component, not the React module! v0.x

Comments

@scarletsky
Copy link
Contributor

Problem description

fullWidth not work in RaisedButton when upgrade to 0.15.0.
In 0.15.0-beta.2, it works.

Steps to reproduce

Just set fullWidth to true in RaisedButton.

<RaisedButton label="add section" fullWidth={true}  />

a3f722c2-992e-4b01-a34d-214ae82a7f75

Versions

  • Material-UI: 0.15.0
  • React: 15.0.1
  • Browser: Chrome 50
@mbrookes
Copy link
Member

Since this prop is being used, lets get the fix in to 0.15.1, and we can deprecate in favour of style in 0.16.0.

@mbrookes mbrookes added this to the 0.15.1 Release milestone May 29, 2016
@s-ol
Copy link

s-ol commented Jun 9, 2016

can confirm. All it needs is a width: 100% on the div container.

@mbrookes
Copy link
Member

mbrookes commented Jun 9, 2016

@s-ol #4226 (as referenced above).

@scarletsky
Copy link
Contributor Author

@mbrookes @oliviertassinari
Hello, I just upgrade to 0.15.1, and I have the same issue.
I've check the RaisedButton's source code, it should work as expect.

...
return {
    root: {
      display: 'inline-block',
      transition: transitions.easeOut(),
      minWidth: fullWidth ? '100%' : button.minWidth,
    },
    button: {
      position: 'relative',
      height: buttonHeight,
      lineHeight: `${buttonHeight}px`,
      width: '100%',
      padding: 0,
      borderRadius: borderRadius,
      transition: transitions.easeOut(),
      backgroundColor: backgroundColor,
      // That's the default value for a button but not a link
      textAlign: 'center',
    }
...

But when I check node_modules/material-ui, there is something wrong. Please have a look:

$ pwd
/Users/scarlex/Projects/testlibs/node_modules/material-ui

$ tail package.json
    "react-tap-event-plugin": "^1.0.0"
  },
  "readme": "ERROR: No README data found!",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/callemall/material-ui.git"
  },
  "scripts": {},
  "version": "0.15.1"
}

$ cat RaisedButton/RaisedButton.js
...
return {
    root: {
      display: 'inline-block',
      transition: _transitions2.default.easeOut()
    },
    button: {
      position: 'relative',
      minWidth: fullWidth ? '100%' : button.minWidth,
      height: buttonHeight,
      lineHeight: buttonHeight + 'px',
      width: '100%',
      padding: 0,
      borderRadius: borderRadius,
      transition: _transitions2.default.easeOut(),
      backgroundColor: backgroundColor,
      // That's the default value for a button but not a link
      textAlign: 'center'
    },
...

I have no idea why root.minWidth miss.

@oliviertassinari
Copy link
Member

@scarletsky some commits are missing from the v0.15.1 release. We are going to address it with a v0.15.2 one. That should be done soon. You can track #4572 to keep you up to date.

@scarletsky
Copy link
Contributor Author

@oliviertassinari 😃 Oh, I see, thanks for your reply !

@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added component: button This is the name of the generic UI component, not the React module! v0.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! v0.x
Projects
None yet
5 participants