Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankush263 committed Sep 11, 2023
1 parent 62df487 commit 8ac9dcb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/modules/IDE/components/SketchList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ class SketchListRowBase extends React.Component {
};

handleRenameEnter = (e) => {
if (e.key === 'Enter') {
this.updateName();
}
};

handleEnter = (e) => {
if (e.key === 'Enter') {
this.updateName();
this.closeAll();
Expand All @@ -116,7 +122,7 @@ class SketchListRowBase extends React.Component {
this.closeAll();
};

updateName = () => {
updateName = (e) => {
const isValid = this.state.renameValue.trim().length !== 0;
if (isValid) {
this.props.changeProjectName(
Expand Down Expand Up @@ -300,6 +306,7 @@ class SketchListRowBase extends React.Component {
value={renameValue}
onChange={this.handleRenameChange}
onKeyUp={this.handleRenameEnter}
onKeyDown={this.handleEnter}
onBlur={this.handleRenameBlur}
onClick={(e) => e.stopPropagation()}
ref={this.renameInput}
Expand Down

0 comments on commit 8ac9dcb

Please sign in to comment.