From ab673fe771cc688f985cf56e62ad58e847c1a9a4 Mon Sep 17 00:00:00 2001 From: nik72619c Date: Fri, 28 Feb 2020 01:57:28 +0530 Subject: [PATCH] Fix focus not coming on clicking on the rename option for a sketch, inside the Sketch Modal --- client/modules/IDE/components/SketchList.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index 89d5cb10..5670c2d6 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -29,6 +29,7 @@ class SketchListRowBase extends React.Component { renameValue: props.sketch.name, isFocused: false }; + this.renameInput = React.createRef(); } onFocusComponent = () => { this.setState({ isFocused: true }); @@ -66,7 +67,7 @@ class SketchListRowBase extends React.Component { openRename = () => { this.setState({ renameOpen: true - }); + }, () => this.renameInput.current.focus()); } closeRename = () => { @@ -158,6 +159,7 @@ class SketchListRowBase extends React.Component { onKeyUp={this.handleRenameEnter} onBlur={this.resetSketchName} onClick={e => e.stopPropagation()} + ref={this.renameInput} /> }