Skip to content

[RaisedButton] Fix label validation for 0 (number data-type)#4285

Closed
mrdivyansh wants to merge 1 commit intomui:masterfrom
mrdivyansh:raisedBtnLabelValidationFix
Closed

[RaisedButton] Fix label validation for 0 (number data-type)#4285
mrdivyansh wants to merge 1 commit intomui:masterfrom
mrdivyansh:raisedBtnLabelValidationFix

Conversation

@mrdivyansh
Copy link
Copy Markdown

@mrdivyansh mrdivyansh commented May 17, 2016

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s)

RaisedButton throw an error when label is zero (numeric data-type). This is special case, so we should handle it in validation function.


function validateLabel(props, propName, componentName) {
if (!props.children && !props.label && !props.icon) {
if (!props.children && (!props.label && props.label !== 0) && !props.icon) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment than here #4284 (comment).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment #4284 Comment

@mrdivyansh
Copy link
Copy Markdown
Author

@mbrookes @oliviertassinari Any update ?

@mrdivyansh
Copy link
Copy Markdown
Author

@oliviertassinari @mbrookes If PR is still not good, please could you do it by own. we need this fix on master branch as soon as possible.

@mbrookes
Copy link
Copy Markdown
Member

mbrookes commented May 30, 2016

Tested in this PR: #4346, specifically here: https://github.com/callemall/material-ui/pull/4346/files#diff-8cedf1e57ff556e069369f4f697bd932R131

Please open an issue if you believe this is still broken in master.

@mbrookes mbrookes closed this May 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants