Bug 1441974 - Avoid duplicate clicks in sidebar toggle. r=miker
After the React monkeypatch removal (
bug 1420130), some events can be duplicated
because both privileged and non-privileged versions are dispatched.
To work around this, we can stop propagation for the event in cases like this
where it is safe to do so.
MozReview-Commit-ID: L6cHpuTw1D2
--- a/devtools/client/shared/components/SidebarToggle.js
+++ b/devtools/client/shared/components/SidebarToggle.js
@@ -39,16 +39,17 @@ class SidebarToggle extends Component {
};
this.onClick = this.onClick.bind(this);
}
// Events
onClick(event) {
+ event.stopPropagation();
this.props.onClick(event);
}
// Rendering
render() {
let title = this.state.collapsed ?
this.props.expandPaneTitle :