Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Fix wrong scope of focusing active table row #968
Browse files Browse the repository at this point in the history
  • Loading branch information
wiadev committed Jul 6, 2017
1 parent 6a82e3c commit c2479cf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,16 @@ class Table extends Component {
}

triggerFocus = (idFocused, idFocusedDown) => {
const rowSelected = document.getElementsByClassName('row-selected');
if(rowSelected.length > 0){
if(typeof idFocused == 'number'){
rowSelected[0].children[idFocused].focus();
}
if(typeof idFocusedDown == 'number'){
rowSelected[rowSelected.length-1]
.children[idFocusedDown].focus();
if (this.table) {
const rowSelected = this.table.getElementsByClassName('row-selected');
if(rowSelected.length > 0){
if(typeof idFocused == 'number'){
rowSelected[0].children[idFocused].focus();
}
if(typeof idFocusedDown == 'number'){
rowSelected[rowSelected.length-1]
.children[idFocusedDown].focus();
}
}
}
}
Expand Down

0 comments on commit c2479cf

Please sign in to comment.