Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adds onKeyUp event to header for sort
  • Loading branch information
Michael-Hanley committed Feb 8, 2020
commit 87caa371334562fcf6fde23e355b767a1498ce2c
6 changes: 6 additions & 0 deletions packages/react-bootstrap-table2/src/header-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ class HeaderCell extends eventDelegater(React.Component) {

if (sort) {
const customClick = cellAttrs.onClick;
cellAttrs.onKeyUp = (e) => {
if (e.key === 'Enter') {
onSort(column);
if (_.isFunction(customClick)) customClick(e);
}
};
cellAttrs.onClick = (e) => {
onSort(column);
if (_.isFunction(customClick)) customClick(e);
Expand Down