committed by
Jaco Greeff
parent
04ed53e0f2
commit
0f41c5b847
@@ -18,6 +18,7 @@ import { Dialog } from 'material-ui';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { nodeOrStringProptype } from '~/util/proptypes';
|
||||
|
||||
@@ -49,6 +50,14 @@ class Modal extends Component {
|
||||
waiting: PropTypes.array
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
const element = ReactDOM.findDOMNode(this.refs.dialog);
|
||||
|
||||
if (element) {
|
||||
element.focus();
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
const { muiTheme } = this.context;
|
||||
const { actions, busy, children, className, current, compact, settings, steps, title, visible, waiting } = this.props;
|
||||
@@ -85,9 +94,12 @@ class Modal extends Component {
|
||||
<Container
|
||||
compact={ compact }
|
||||
light
|
||||
ref='dialog'
|
||||
style={
|
||||
{ transition: 'none' }
|
||||
}>
|
||||
}
|
||||
tabIndex={ 0 }
|
||||
>
|
||||
{ children }
|
||||
</Container>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user