return { open, value };
},
- componentWillMount() {
- document.addEventListener('click', this.handleDocumentClick, false);
- },
-
componentWillReceiveProps(nextProps) {
const { value, open } = nextProps;
if (value !== undefined) {
}
},
- componentWillUnmount() {
- document.removeEventListener('click', this.handleDocumentClick, false);
- },
-
onPanelChange(value) {
const props = this.props;
this.setState({
}
},
- handleDocumentClick(event) {
- // hide popup when click outside
- if (this.state.open && ReactDOM.findDOMNode(this.panelInstance).contains(event.target)) {
- return;
- }
- this.setState({
- open: false,
- });
- },
-
focus() {
if (!this.state.open) {
ReactDOM.findDOMNode(this).focus();