diff --git a/packages/cloud-cognitive/src/components/Datagrid/useOnRowClick.js b/packages/cloud-cognitive/src/components/Datagrid/useOnRowClick.js index 083638d165..f564db62d1 100644 --- a/packages/cloud-cognitive/src/components/Datagrid/useOnRowClick.js +++ b/packages/cloud-cognitive/src/components/Datagrid/useOnRowClick.js @@ -23,10 +23,18 @@ const useOnRowClick = (hooks) => { } }; + const onKeyDown = (event) => { + const { key } = event; + if (key === 'Enter') { + onClick(); + } + }; + return [ props, - { onClick }, + { onClick, onKeyDown }, { + tabIndex: 0, style: { cursor: 'pointer', },