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

Commit

Permalink
Table selection fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
damianprzygodzki committed Jan 2, 2017
1 parent 3b3c484 commit cd030d0
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ class Table extends Component {
window.open("/window/" + type + "/" + selected[0], "_blank");
}

handleKey = (e) => {
const {readonly, mainTable} = this.props;
const {listenOnKeys} = this.state;

if(listenOnKeys){
if(!readonly){
this.handleKeyDown(e);
}else if(mainTable){
this.handleKeyDownDocList(e)
}
}
}

render() {
const {
cols, type, docId, rowData, tabid, readonly, size, handleChangePage,
Expand Down Expand Up @@ -486,12 +499,7 @@ class Table extends Component {
"table table-bordered-vertically table-striped " +
(readonly ? "table-read-only" : "")
}
onKeyDown = { (listenOnKeys && !readonly) ?
(e) => this.handleKeyDown(e) :
(listenOnKeys && mainTable) ?
(e) => this.handleKeyDownDocList(e) :
''
}
onKeyDown={this.handleKey}
tabIndex={tabIndex}
onFocus={this.handleFocus}
ref={c => this.table = c}
Expand Down

0 comments on commit cd030d0

Please sign in to comment.