Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,17 @@ export default class Table extends PureComponent {
? SortDirection.ASC
: SortDirection.DESC

const onClick = () => {
const onClick = (evt) => {
sortEnabled && sort({
sortBy: dataKey,
sortDirection: newSortDirection
})
onHeaderClick && onHeaderClick({ columnData, dataKey })
onHeaderClick && onHeaderClick({ evt, columnData, dataKey })
}

const onKeyDown = (event) => {
if (event.key === 'Enter' || event.key === ' ') {
onClick()
onClick(event)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit weird- though I understand why you did it. I guess it's okay since people can ignore the event or check its type

}
}

Expand Down
8 changes: 4 additions & 4 deletions source/Table/defaultRowRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ export default function defaultRowRenderer ({
a11yProps.tabIndex = 0

if (onRowClick) {
a11yProps.onClick = () => onRowClick({ index, rowData })
a11yProps.onClick = (evt) => onRowClick({ evt, index, rowData })
}
if (onRowDoubleClick) {
a11yProps.onDoubleClick = () => onRowDoubleClick({ index, rowData })
a11yProps.onDoubleClick = (evt) => onRowDoubleClick({ evt, index, rowData })
}
if (onRowMouseOut) {
a11yProps.onMouseOut = () => onRowMouseOut({ index, rowData })
a11yProps.onMouseOut = (evt) => onRowMouseOut({ evt, index, rowData })
}
if (onRowMouseOver) {
a11yProps.onMouseOver = () => onRowMouseOver({ index, rowData })
a11yProps.onMouseOver = (evt) => onRowMouseOver({ evt, index, rowData })
}
}

Expand Down