fix: open component with keyboard within unit page (#2256)

When selecting a component inside a unit with the keyboard, opening it in the sidebar by pressing enter was not working.
This commit is contained in:
Daniel Valenzuela
2025-07-07 18:34:21 -04:00
committed by GitHub
parent a969de4d90
commit 642be162d7

View File

@@ -182,6 +182,11 @@ const ComponentBlock = ({ block, readOnly, isDragging }: ComponentBlockProps) =>
}}
isClickable={!readOnly}
onClick={(e) => !readOnly && handleComponentSelection(e.detail)}
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleComponentSelection(e.detail);
}
}}
disabled={readOnly}
cardClassName={sidebarItemInfo?.id === block.originalId ? 'selected' : undefined}
>