We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a23a4da commit 3076dc7Copy full SHA for 3076dc7
1 file changed
src/course-outline/card-header/CardHeader.tsx
@@ -178,9 +178,14 @@ const CardHeader = ({
178
onChange={(e) => setTitleValue(e.target.value)}
179
aria-label={intl.formatMessage(messages.editFieldAriaLabel)}
180
onBlur={() => onEditSubmit(titleValue)}
181
- onKeyDown={(e) => {
+ onKeyDown={/* istanbul ignore next */ (e) => {
182
if (e.key === 'Enter') {
183
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();
189
}
190
}}
191
disabled={isSaving}
0 commit comments