Skip to content

Commit 8ef1a67

Browse files
Fixed #8218 - DataTable: fixing tabindex initialization with initial selection set
1 parent 0a06da2 commit 8ef1a67

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/primevue/src/datatable/BodyRow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export default {
507507
return [this.cx('row', { rowData: this.rowData, index: this.rowIndex, columnSelectionMode }), rowStyleClass];
508508
},
509509
rowTabindex() {
510-
if (this.selection === null && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {
510+
if ((this.selection === null || (Array.isArray(this.selection) && this.selection.length === 0)) && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {
511511
return this.rowIndex === 0 ? 0 : -1;
512512
}
513513

0 commit comments

Comments
 (0)