-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add scope attribute support for table headers #7853
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
base: develop
Are you sure you want to change the base?
Conversation
Preserve and render the 'scope' attribute from th elements to improve table accessibility for screen readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for preserving and rendering the scope
attribute on <th>
elements to improve table accessibility.
- Extracts
scope
from header<th>
attributes into column configuration - Includes
scope
when generating header cell HTML
Comments suppressed due to low confidence (1)
src/bootstrap-table.js:201
- [nitpick] The new
scope
option should be documented in the public API docs or JSDoc comments so consumers know this attribute is now supported.
scope: $th.attr('scope'),
Utils.sprintf(' data-field="%s"', column.field), | ||
Utils.sprintf(' scope="%s"', column.scope), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Utils.sprintf(' data-field="%s"', column.field), | |
Utils.sprintf(' scope="%s"', column.scope), | |
Utils.sprintf(' scope="%s"', column.scope), | |
Utils.sprintf(' data-field="%s"', column.field), |
scope: $th.attr('scope') ? $th.attr('scope') : undefined, | ||
rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined, | ||
colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope: $th.attr('scope') ? $th.attr('scope') : undefined, | |
rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined, | |
colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined | |
rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined, | |
colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined, | |
scope: $th.attr('scope') ? $th.attr('scope') : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest keeping the same order.
Preserve and render the 'scope' attribute from th elements to improve table accessibility for screen readers.
🤔Type of Request
🔗Resolves an issue?
Fix #7780
📝Changelog
💡Example(s)?
https://live.bootstrap-table.com/code/djhvscf/18817
☑️Self Check before Merge