From bf225bfbb4a82c1267cecf82ce3b59c45a43614c Mon Sep 17 00:00:00 2001 From: Piyush Date: Fri, 7 Jun 2024 20:41:11 +0530 Subject: [PATCH] Fix edit rename using keyboard controls on SketchList && CollectionList --- .../IDE/components/CollectionList/CollectionListRow.jsx | 3 ++- client/modules/IDE/components/SketchList.jsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/CollectionList/CollectionListRow.jsx b/client/modules/IDE/components/CollectionList/CollectionListRow.jsx index dafbe21517..fb066c3a80 100644 --- a/client/modules/IDE/components/CollectionList/CollectionListRow.jsx +++ b/client/modules/IDE/components/CollectionList/CollectionListRow.jsx @@ -66,6 +66,7 @@ const CollectionListRowBase = (props) => { const handleRenameEnter = (e) => { if (e.key === 'Enter') { + e.preventDefault(); updateName(); closeAll(); } @@ -113,7 +114,7 @@ const CollectionListRowBase = (props) => { e.stopPropagation()} ref={renameInput} diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index 2237227766..6f8b5b513d 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -64,6 +64,7 @@ class SketchListRowBase extends React.Component { handleRenameEnter = (e) => { if (e.key === 'Enter') { + e.preventDefault(); this.updateName(); this.closeRename(); } @@ -173,7 +174,7 @@ class SketchListRowBase extends React.Component { e.stopPropagation()} ref={this.renameInput}