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

Grid select support singleSelect #1645

Merged
merged 6 commits into from
Jan 21, 2021

Conversation

youngBrain1893
Copy link
Contributor

@youngBrain1893 youngBrain1893 commented Jan 18, 2021

Changes you made in this pull request:

  • Grid 添加 单选支持
  • Grid props.selection 废弃 getCheckboxProps 对应调整为 getSelectionProps

Closes #1643

@youngBrain1893
Copy link
Contributor Author

youngBrain1893 commented Jan 20, 2021

为什么嵌在span里面,是这次改动引起的吗 -_-

React 16.x 的某个版本改变了元素 disabled 的行为,mouse相关事件不会触发 facebook/react#10109

所以 Grid disabled reason 展示的功能失效了

Copy link
Contributor

@cpylua cpylua left a comment

Choose a reason for hiding this comment

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

再改下

1. 添加废弃属性注释
2. 调整 demo
3. 调整 checkbox/radio 包裹元素 cls
Comment on lines 51 to 61
// 等重构再删了吧,改不动
// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(
nextProps: IGridSelectionRadioProps,
nextState: IGridSelectionRadioState
) {
const checked = this.getCheckState(nextProps);
if (checked !== nextState.checked) {
this.setState({ checked });
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

不要用 willReceiveProps

@cpylua cpylua merged commit 7227d23 into youzan:master Jan 21, 2021
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

Successfully merging this pull request may close these issues.

Grid 支持单选
3 participants