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
1 changed files with 3 additions and 1 deletions

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>