Skip to content

Commit 642be16

Browse files
authored
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.
1 parent a969de4 commit 642be16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/library-authoring/units/LibraryUnitBlocks.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ const ComponentBlock = ({ block, readOnly, isDragging }: ComponentBlockProps) =>
182182
}}
183183
isClickable={!readOnly}
184184
onClick={(e) => !readOnly && handleComponentSelection(e.detail)}
185+
onKeyDown={(e) => {
186+
if (e.key === 'Enter') {
187+
handleComponentSelection(e.detail);
188+
}
189+
}}
185190
disabled={readOnly}
186191
cardClassName={sidebarItemInfo?.id === block.originalId ? 'selected' : undefined}
187192
>

0 commit comments

Comments
 (0)