Skip to content

Commit c245e0d

Browse files
committed
fix: Bug when adding spaces to containers names in course outline
- Fixes the bug introduced in openedx#2732 - Removes the unnecessary `preventDefault`
1 parent 4cda17e commit c245e0d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/course-outline/card-header/CardHeader.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ const CardHeader = ({
181181
onKeyDown={(e) => {
182182
if (e.key === 'Enter') {
183183
onEditSubmit(titleValue);
184+
} else if (e.key === ' ') {
185+
// Avoid passing propagation to the `SortableItem` in the card,
186+
// which executes a `preventDefault`. If propagation is not prevented,
187+
// spaces cannot be added to names.
188+
e.stopPropagation();
184189
}
185190
}}
186191
disabled={isSaving}

0 commit comments

Comments
 (0)