allowEmpty: PropTypes.bool,
defaultOpenValue: PropTypes.object,
currentSelectPanel: PropTypes.string,
+ focusOnOpen: PropTypes.bool,
};
constructor(props) {
};
}
+ componentDidMount() {
+ if (this.props.focusOnOpen) {
+ // Wait one frame for the panel to be positioned before focusing
+ const requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout);
+ requestAnimationFrame(() => this.refs.input.focus());
+ }
+ }
+
componentWillReceiveProps(nextProps) {
const { value, format } = nextProps;
this.setState({