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

Radio组件 当children===0时无法显示 #4874

Closed
HQidea opened this issue Feb 15, 2017 · 2 comments · Fixed by #4882
Closed

Radio组件 当children===0时无法显示 #4874

HQidea opened this issue Feb 15, 2017 · 2 comments · Fixed by #4882
Labels
🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.

Comments

@HQidea
Copy link
Contributor

HQidea commented Feb 15, 2017

Environment(required)

  • antd version: 1.8.0 - 1.11.6
  • OS and its version: all
  • Browser and its version: all

What did you do? Please provide steps to re-produce your problem.

<Radio
  key={key}
  value={key}
>
  {0}
</Radio>

What do you expected?

正常显示 0

What happen?

    return (
      <label className={wrapperClassString} style={style}>
        <RcRadio {...this.props} className={classString} style={null} children={null} />
        {children ? <span>{children}</span> : null}
      </label>
    );

这里的children判断不严谨,导致child === 0的时候会被认为没有children

link: https://github.com/ant-design/ant-design/blob/1.x-stable/components/radio/radio.jsx#L29

Re-producible online demo

http://codepen.io/anon/pen/egXJGe?editors=001

@afc163
Copy link
Member

afc163 commented Feb 15, 2017

来个 PR 发到 master 吧~

另外 antd@1.x 不会维护了。

@afc163 afc163 added 🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. labels Feb 15, 2017
@HQidea HQidea mentioned this issue Feb 15, 2017
4 tasks
@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants