Dropdown doesn't close on click outside fix
Hi there, Dropdown component doesn't close on click outside in my app. I debugged a little bit problem and found that componentWillUpdate uses incorrect. It accepts nextProps and nextState and not prevState and nextState https://facebook.github.io/react/docs/component-specs.html#updating-componentwillupdateold
parent
d8a58bd225
commit
c1f2b83865
|
@ -34,8 +34,8 @@ class Dropdown extends React.Component {
|
|||
up: false
|
||||
};
|
||||
|
||||
componentWillUpdate (prevState, nextState) {
|
||||
if (!prevState.active && nextState.active) {
|
||||
componentWillUpdate (nextProps, nextState) {
|
||||
if (!this.state.active && nextState.active) {
|
||||
events.addEventsToDocument({click: this.handleDocumentClick});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue