defaultOpenValue: PropTypes.object,
currentSelectPanel: PropTypes.string,
focusOnOpen: PropTypes.bool,
+ onKeyDown: PropTypes.func,
};
constructor(props) {
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());
+ requestAnimationFrame(() => {
+ this.refs.input.focus();
+ this.refs.input.select();
+ });
}
}
}
onKeyDown = (e) => {
+ const { onEsc, onKeyDown } = this.props;
if (e.keyCode === 27) {
- this.props.onEsc();
+ onEsc();
}
+
+ onKeyDown(e);
}
onClear = () => {