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

fix: 🐞 Fix selectedRows missing when there is childrenColumnName in Table #16616

Merged
merged 1 commit into from May 16, 2019

Conversation

afc163
Copy link
Member

@afc163 afc163 commented May 16, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

👻 What's the background?

close #16614

💡 Solution

📝 Changelog

  • English Changelog: 🐞 Fixed Table selectedRows argument in onChange missing when specified childrenColumnName.
  • Chinese Changelog (optional): 🐞 修复 Table onChangeselectedRows 参数当指定了 childrenColumnName 时为空的问题。

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@@ -1066,10 +1067,12 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
}

getFlatData() {
return flatArray(this.getLocalData(null, false));
const { childrenColumnName } = this.props;
return flatArray(this.getLocalData(null, false), childrenColumnName);
Copy link
Member Author

Choose a reason for hiding this comment

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

关键代码在此。

@netlify
Copy link

netlify bot commented May 16, 2019

Deploy preview for ant-design ready!

Built with commit c4128c0

https://deploy-preview-16616--ant-design.netlify.com

@codecov
Copy link

codecov bot commented May 16, 2019

Codecov Report

Merging #16616 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16616      +/-   ##
==========================================
+ Coverage    95.7%   95.74%   +0.04%     
==========================================
  Files         258      258              
  Lines        7125     7127       +2     
  Branches     2007     2007              
==========================================
+ Hits         6819     6824       +5     
+ Misses        304      301       -3     
  Partials        2        2
Impacted Files Coverage Δ
components/table/Table.tsx 93.41% <100%> (+0.02%) ⬆️
components/_util/wave.tsx 88.67% <0%> (+2.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8836439...c4128c0. Read the comment docs.

@afc163 afc163 merged commit 40836c2 into master May 16, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-selectedRows-bug branch May 16, 2019 07:10
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.

Table 设置 childrenColumnName,选择子结构好的行数据,时候selectedRows没有
1 participant