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:
committed by
GitHub
parent
a969de4d90
commit
642be162d7
@@ -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}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user