diff options
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Switch.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/components/Switch.js b/app/components/Switch.js index 4f97c4d992..f0ad3b41bc 100644 --- a/app/components/Switch.js +++ b/app/components/Switch.js @@ -119,6 +119,13 @@ export default class Switch extends Component { this.isCapturingMouseEvents = false; } + componentWillUnmount() { + // guard from abrupt programmatic unmount + if(this.isCapturingMouseEvents) { + this.stopCapturingMouseEvents(); + } + } + render(): React.Element<*> { const { isOn, onChange, ...otherProps } = this.props; // eslint-disable-line no-unused-vars let className = ('switch' + ' ' + (otherProps.className || '')).trim(); |
