Skip to content
Permalink
Browse files

feat(b-table, b-table-lite): use `aria-details` rather than `aria-des…

…cribedby` when details row showing (addresses #3801) (#3992)
  • Loading branch information...
tmorehouse committed Aug 31, 2019
1 parent 444d8b0 commit f6f73c7ac8f4a54196be5f0ee08c99c76e8f8b13
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/components/table/helpers/mixin-tbody-row.js
@@ -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
@@ -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
@@ -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)
])

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

0 comments on commit f6f73c7

Please sign in to comment.
You can’t perform that action at this time.