Skip to content

Commit ab673fe

Browse files
committed
Fix focus not coming on clicking on the rename option for a sketch, inside the Sketch Modal
1 parent ab7f427 commit ab673fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/modules/IDE/components/SketchList.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class SketchListRowBase extends React.Component {
2929
renameValue: props.sketch.name,
3030
isFocused: false
3131
};
32+
this.renameInput = React.createRef();
3233
}
3334
onFocusComponent = () => {
3435
this.setState({ isFocused: true });
@@ -66,7 +67,7 @@ class SketchListRowBase extends React.Component {
6667
openRename = () => {
6768
this.setState({
6869
renameOpen: true
69-
});
70+
}, () => this.renameInput.current.focus());
7071
}
7172

7273
closeRename = () => {
@@ -158,6 +159,7 @@ class SketchListRowBase extends React.Component {
158159
onKeyUp={this.handleRenameEnter}
159160
onBlur={this.resetSketchName}
160161
onClick={e => e.stopPropagation()}
162+
ref={this.renameInput}
161163
/>
162164
}
163165
</th>

0 commit comments

Comments
 (0)