Skip to content

Commit

Permalink
feat(b-table, b-table-lite): use aria-details rather than `aria-des…
Browse files Browse the repository at this point in the history
…cribedby` when details row showing (addresses #3801) (#3992)
  • Loading branch information
tmorehouse committed Aug 31, 2019
1 parent 444d8b0 commit f6f73c7
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit f6f73c7

Please sign in to comment.