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(table): fix Table aria-label contains [object Object] #38389

Merged
merged 11 commits into from Nov 5, 2022

Conversation

kiner-tang
Copy link
Member

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

aria-label should be use the first text content in element when column title is ReactElement in table

📝 Changelog

Language Changelog
🇺🇸 English Fix Table aria-label contains [object Object].
🇨🇳 Chinese 修复 Table 组件 aria-label 出现 [object Object] 的问题。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • 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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (91aebc9) compared to base (8a42af3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #38389   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          446       446           
  Lines         8295      8304    +9     
  Branches      2520      2523    +3     
=========================================
+ Hits          8295      8304    +9     
Impacted Files Coverage Δ
components/table/hooks/useSorter.tsx 100.00% <100.00%> (ø)
components/table/util.ts 100.00% <100.00%> (ø)
components/_util/ActionButton.tsx 100.00% <0.00%> (ø)
components/upload/UploadList/ListItem.tsx 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

title: ColumnTitle<RecordType>,
props: ColumnTitleProps<RecordType>,
) {
const res = renderColumnTitle(title, props);
Copy link
Contributor

Choose a reason for hiding this comment

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

如果直接改 renderColumnTitle 会有啥影响不

Copy link
Member Author

Choose a reason for hiding this comment

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

直接改容易出问题,目前其实就是aria-labeltitle当中需要纯字符串类型的值,其他场景一般都是可以是ReactNode或其他合法的类型。

@afc163 afc163 merged commit 2dbfbea into ant-design:master Nov 5, 2022
elevensky pushed a commit to elevensky/ant-design that referenced this pull request Nov 12, 2022
…sign#38389)

* fix: columns title render not as expected

* feat: code optimize

* feat: update test case

* feat: update test case

* feat: code optimize

* Update components/table/__tests__/Table.test.tsx

Co-authored-by: afc163 <afc163@gmail.com>

* feat: update aria-label

* feat: update test case

* feat: update snapshots

* feat: update snapshots

Co-authored-by: tangwenhui <tangwenhui@rd.netease.com>
Co-authored-by: afc163 <afc163@gmail.com>
elevensky pushed a commit to elevensky/ant-design that referenced this pull request Nov 22, 2022
…sign#38389)

* fix: columns title render not as expected

* feat: code optimize

* feat: update test case

* feat: update test case

* feat: code optimize

* Update components/table/__tests__/Table.test.tsx

Co-authored-by: afc163 <afc163@gmail.com>

* feat: update aria-label

* feat: update test case

* feat: update snapshots

* feat: update snapshots

Co-authored-by: tangwenhui <tangwenhui@rd.netease.com>
Co-authored-by: afc163 <afc163@gmail.com>
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 sort buttons aria-label is [object Object]
3 participants