@@ -205,12 +205,12 @@ export default {
205205 // rows index within the tbody.
206206 // See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2410
207207 const primaryKey = this . primaryKey
208- const hasPkValue = primaryKey && ! isUndefinedOrNull ( item [ primaryKey ] )
209- const rowKey = hasPkValue ? toString ( item [ primaryKey ] ) : String ( rowIndex )
208+ const primaryKeyValue = toString ( get ( item , primaryKey ) ) || null
209+ const rowKey = primaryKeyValue || String ( rowIndex )
210210
211211 // If primary key is provided, use it to generate a unique ID on each tbody > tr
212212 // In the format of '{tableId}__row_{primaryKeyValue}'
213- const rowId = hasPkValue ? this . safeId ( `_row_${ item [ primaryKey ] } ` ) : null
213+ const rowId = primaryKeyValue ? this . safeId ( `_row_${ primaryKeyValue } ` ) : null
214214
215215 // Selectable classes and attributes
216216 const selectableClasses = this . selectableRowClasses ? this . selectableRowClasses ( rowIndex ) : { }
@@ -233,8 +233,7 @@ export default {
233233 attrs : {
234234 id : rowId ,
235235 tabindex : hasRowClickHandler ? '0' : null ,
236- 'data-pk' : rowId ? String ( item [ primaryKey ] ) : null ,
237- // Should this be `aria-details` instead?
236+ 'data-pk' : primaryKeyValue || null ,
238237 'aria-details' : detailsId ,
239238 'aria-owns' : detailsId ,
240239 'aria-rowindex' : ariaRowIndex ,
0 commit comments