mirror of
https://github.com/wassname/talk.git
synced 2026-09-30 11:43:46 +08:00
Removing global listeners
This commit is contained in:
1 parent
f2ea269f7a
commit
18b18a7aef
1 file changed
-10
@@ -29,16 +29,6 @@ class Dropdown extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
compoentDidMount() {
|
||||
document.addEventListener('click', this.handleClick, false);
|
||||
document.addEventListener('touchend', this.handleClick, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('click', this.handleClick, false);
|
||||
document.removeEventListener('touchend', this.handleClick, false);
|
||||
}
|
||||
|
||||
fireChange = (newState) => {
|
||||
if (newState.selected !== this.state.selected && this.props.onChange) {
|
||||
this.props.onChange(newState.selected.value);
|
||||
|
||||
Reference in new issue
Block a user