Skip to content

Commit 87caa37

Browse files
Adds onKeyUp event to header for sort
1 parent b8c9712 commit 87caa37

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-bootstrap-table2/src/header-cell.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ class HeaderCell extends eventDelegater(React.Component) {
7777

7878
if (sort) {
7979
const customClick = cellAttrs.onClick;
80+
cellAttrs.onKeyUp = (e) => {
81+
if (e.key === 'Enter') {
82+
onSort(column);
83+
if (_.isFunction(customClick)) customClick(e);
84+
}
85+
};
8086
cellAttrs.onClick = (e) => {
8187
onSort(column);
8288
if (_.isFunction(customClick)) customClick(e);

0 commit comments

Comments
 (0)