Fix focus not coming on clicking on the rename option for a sketch, inside the Sketch Modal

This commit is contained in:
nik72619c 2020-02-28 01:57:28 +05:30
parent ab7f4279bd
commit ab673fe771

View file

@ -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}
/>
}
</th>