Make owner stack reachable by keyboard

This commit is contained in:
Dan
2019-04-04 09:56:37 +01:00
parent 7fbdfd9f5a
commit b1c675b8b1
@@ -206,12 +206,25 @@ function OwnerView({ displayName, id }: { displayName: string, id: number }) {
selectElementByID,
]);
const handleKeyPress = useCallback(
e => {
if (e.key === ' ' || e.key === 'Enter') {
e.preventDefault();
selectElementByID(id);
}
},
[id, selectElementByID]
);
return (
<div
key={id}
className={styles.Owner}
onClick={handleClick}
onKeyPress={handleKeyPress}
title={displayName}
tabIndex={0}
role="button"
>
{displayName}
</div>