From a7de39ef4c81970f46c08137301a8cd5e44346a8 Mon Sep 17 00:00:00 2001 From: XnpioChV Date: Wed, 14 Jan 2026 12:24:04 -0500 Subject: [PATCH] fix: Bug when adding spaces to containers names in course outline - Fixes the bug introduced in https://github.com/openedx/frontend-app-authoring/pull/2732 - Removes the unnecessary `preventDefault` --- src/course-outline/card-header/CardHeader.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/course-outline/card-header/CardHeader.tsx b/src/course-outline/card-header/CardHeader.tsx index 329529f4d7..572c91a3e6 100644 --- a/src/course-outline/card-header/CardHeader.tsx +++ b/src/course-outline/card-header/CardHeader.tsx @@ -178,9 +178,14 @@ const CardHeader = ({ onChange={(e) => setTitleValue(e.target.value)} aria-label={intl.formatMessage(messages.editFieldAriaLabel)} onBlur={() => onEditSubmit(titleValue)} - onKeyDown={(e) => { + onKeyDown={/* istanbul ignore next */ (e) => { if (e.key === 'Enter') { onEditSubmit(titleValue); + } else if (e.key === ' ') { + // Avoid passing propagation to the `SortableItem` in the card, + // which executes a `preventDefault`. If propagation is not prevented, + // spaces cannot be added to names. + e.stopPropagation(); } }} disabled={isSaving}