Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(b-table, b-table-lite): use aria-details rather than aria-describedby when details row showing (addresses #3801) #3992

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

Merged
merged 3 commits into from
Aug 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/components/table/helpers/mixin-tbody-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ export default {
// We can return more than one TR if rowDetails enabled
const $rows = []

// Details ID needed for aria-describedby when details showing
// Details ID needed for `aria-details` when details showing
// We set it to `null` when not showing so that attribute
// does not appear on the element
const detailsId = rowShowDetails ? this.safeId(`_details_${rowIndex}_`) : null

// For each item data field in row
Expand Down Expand Up @@ -284,7 +286,7 @@ export default {
tabindex: hasRowClickHandler ? '0' : null,
'data-pk': rowId ? String(item[primaryKey]) : null,
// Should this be `aria-details` instead?
'aria-describedby': detailsId,
'aria-details': detailsId,
'aria-owns': detailsId,
'aria-rowindex': ariaRowIndex,
...selectableAttrs
Expand Down Expand Up @@ -322,7 +324,7 @@ export default {
}

// Render the details slot in a TD
const $details = h(BTd, { props: { colspan: fields.length }, attrs: { id: detailsId } }, [
const $details = h(BTd, { props: { colspan: fields.length } }, [
this.normalizeSlot(detailsSlotName, detailsScope)
])

Expand Down Expand Up @@ -351,7 +353,7 @@ export default {
: this.tbodyTrClass
],
props: { variant: item._rowVariant || null },
attrs: { id: detailsId }
attrs: { id: detailsId, tabindex: '-1' }
},
[$details]
)
Expand Down