Skip to content

Commit bc959e8

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

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ 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+
/* istanbul ignore next */
189+
e.stopPropagation();
184190
}
185191
}}
186192
disabled={isSaving}

0 commit comments

Comments
 (0)