Skip to content

Commit 8b84622

Browse files
committed
Focus value input when 'SelectedElementDialog' gets opened
1 parent e0a7ab9 commit 8b84622

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/ElementDetails/CustomValueInput.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { PropTypes, Component } from 'react'
2+
import ReactDOM from 'react-dom'
23

34
import {
45
PrimitivePropTypes
@@ -14,6 +15,12 @@ export default class CustomValueInput extends Component {
1415
this.customInput = this.customInput.bind(this)
1516
}
1617

18+
componentDidMount() {
19+
if(this.refs.valueInput) {
20+
ReactDOM.findDOMNode(this.refs.valueInput).focus()
21+
}
22+
}
23+
1724
customInput() {
1825
const {
1926
handleChange,
@@ -54,6 +61,7 @@ export default class CustomValueInput extends Component {
5461
return (
5562
<input
5663
onChange={ (e) => handleChange(id, e, workspaceIndex) }
64+
ref="valueInput"
5765
type={ inputType }
5866
value={ value }
5967
/>

0 commit comments

Comments
 (0)