Skip to content

Commit c396fad

Browse files
committed
fix: add support for onEnter on plugin card
1 parent ce67571 commit c396fad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Shared/Components/Plugin/PluginCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ const PluginCard = ({
1616
const { icon, name, description, tags, pluginVersion, updatedBy, docLink } =
1717
pluginDataStore.pluginVersionStore[latestPluginId]
1818

19-
const handleSelection = () => {
19+
const handleSelection = (e: React.MouseEvent | React.KeyboardEvent) => {
20+
if ('key' in e && e.key !== 'Enter') {
21+
return
22+
}
23+
2024
handlePluginSelection(parentPluginId)
2125
}
2226

@@ -26,6 +30,7 @@ const PluginCard = ({
2630
role="button"
2731
tabIndex={0}
2832
onClick={handleSelection}
33+
onKeyDown={handleSelection}
2934
>
3035
{isSelectable && (
3136
<div className={`dc__no-shrink icon-dim-40 p-8 ${!isSelected ? 'dc__visible-hover--child' : ''}`}>

0 commit comments

Comments
 (0)