Fix focus not coming on clicking on the rename option for a sketch, inside the Sketch Modal
This commit is contained in:
parent
ab7f4279bd
commit
ab673fe771
1 changed files with 3 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue