Allow space to trigger submit on project tiles in modal because they are buttons

This commit is contained in:
Paul Kaplan 2021-05-14 12:52:45 -04:00
parent f222dec925
commit 5892f2e7ba

View file

@ -29,7 +29,12 @@ const UserProjectsTile = ({id, title, image, inStudio, onAdd, onRemove}) => {
'mod-mutating': submitting 'mod-mutating': submitting
})} })}
onClick={toggle} onClick={toggle}
onKeyDown={e => e.key === 'Enter' && toggle()} onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
toggle();
e.preventDefault();
}
}}
> >
<img <img
className="studio-project-image" className="studio-project-image"