Skip to content

Commit 776cf80

Browse files
committed
support to disable click to navigation
1 parent d35d570 commit 776cf80

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

css/react-bootstrap-table.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,20 @@
5353

5454
.react-bs-table .table-bordered {
5555
border: 0;
56+
outline: none !important;
5657
}
5758

5859
.react-bs-table .table-bordered > thead > tr > th,
5960
.react-bs-table .table-bordered > thead > tr > td {
6061
border-bottom-width: 2px;
6162
}
6263

64+
.react-bs-table .table-bordered > tbody > tr > td {
65+
outline: none !important;
66+
}
67+
6368
.react-bs-table .table-bordered > tbody > tr > td.default-focus-cell {
64-
outline: 3px solid #3366FF;
69+
outline: 3px solid #3366FF !important;;
6570
outline-offset: -1px;
6671
}
6772

src/BootstrapTable.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -581,15 +581,20 @@ class BootstrapTable extends Component {
581581
}
582582

583583
handleRowClick = (row, rowIndex, cellIndex) => {
584-
if (this.props.options.onRowClick) {
585-
this.props.options.onRowClick(row);
586-
}
587-
if (this.props.keyBoardNav) {
588-
this.setState({
589-
x: cellIndex,
590-
y: rowIndex,
591-
reset: false
592-
});
584+
const { options, keyBoardNav } = this.props;
585+
if (options.onRowClick) {
586+
options.onRowClick(row);
587+
}
588+
if (keyBoardNav) {
589+
let { clickToNav } = typeof keyBoardNav === 'object' ? keyBoardNav : {};
590+
clickToNav = clickToNav === false ? clickToNav : true;
591+
if (clickToNav) {
592+
this.setState({
593+
x: cellIndex,
594+
y: rowIndex,
595+
reset: false
596+
});
597+
}
593598
}
594599
}
595600

0 commit comments

Comments
 (0)