I am making a React app and using http://marcio.github.io/react-skylight/ to implement modals.
export default class SomeComponent extends Component {
...
render() {
return (
...
<SkyLight ref="improveTaskModal">
<form>
<input type="text" ref="myInput" />
...
);
}
}
I want to focus on the input element as soon as the modal opens up. So, I tried doing
_executeAfterModalOpen(){
this.refs.myInput.focus();
}
But, here this
refers to
Object {
hideOnOverlayClicked: true,
afterOpen: wrapMethod/<(),
dialogStyles: Object,
title: "Improve task",
children: Object,
showOverlay: true,
overlayStyles: Object,
closeButtonStyle: Object
}