From 3076dc7598a52e504e588c24321164f813cefc44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Ch=C3=A1vez?= Date: Thu, 15 Jan 2026 09:12:35 -0500 Subject: [PATCH] fix: Bug when adding spaces to containers names in course outline (#2825) - 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 329529f4d..572c91a3e 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}