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`
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user