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

Pass data-* and aria-* props to the body table component #211

Closed
wants to merge 1 commit into from

Conversation

matthewlein
Copy link

Pass data-* and aria-* props to the body table component

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #211      +/-   ##
==========================================
+ Coverage   93.58%   93.62%   +0.04%     
==========================================
  Files          17       17              
  Lines         748      753       +5     
  Branches      196      196              
==========================================
+ Hits          700      705       +5     
  Misses         40       40              
  Partials        8        8
Impacted Files Coverage Δ
src/BaseTable.js 100% <100%> (ø) ⬆️
src/utils.js 100% <100%> (ø) ⬆️
src/BodyTable.js 94.59% <100%> (+0.15%) ⬆️
src/Table.js 86.7% <100%> (+0.07%) ⬆️

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 479bd2e...4eac238. Read the comment docs.

@@ -163,7 +165,7 @@ class BaseTable extends React.Component {
const columns = this.getColumns();

return (
<Table className={tableClassName} style={tableStyle} key="table">
<Table className={tableClassName} style={tableStyle} key="table" {...dataOrAriaProps}>
Copy link
Member

Choose a reason for hiding this comment

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

Why not pass them to

table/src/Table.js

Lines 497 to 502 in 479bd2e

<div
ref={this.saveRef('tableNode')}
className={className}
style={props.style}
id={props.id}
>

Copy link
Author

Choose a reason for hiding this comment

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

My thought is that attributes would be assigned on the native elements that these components represent, when available. On Input it would be on <input>, on Table it would go to the <table>. Others like Select don't use the native html elements, so then it would go to whatever wrapper makes sense.

Copy link
Author

@matthewlein matthewlein Jun 15, 2018

Choose a reason for hiding this comment

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

But I see your point, thats where props.id and props.style is assigned, so it might make the most sense.

@kagd
Copy link
Contributor

kagd commented Jul 18, 2018

+1

@kagd
Copy link
Contributor

kagd commented Jul 30, 2018

Can this one be merged please? I will really aid in an accessibility issue that we are having.

@yesmeck
Copy link
Member

yesmeck commented Jul 31, 2018

@matthewlein

@kagd kagd mentioned this pull request Aug 6, 2018
@matthewlein
Copy link
Author

Closing in favor of #227

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.

4 participants