aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
index e3f468d2dd0..a4d7899387b 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
@@ -46,12 +46,16 @@ interface State {
export default class ComponentNavBranchesMenu extends React.PureComponent<Props, State> {
private node: HTMLElement | null;
- state = { query: '', selected: null };
static contextTypes = {
router: PropTypes.object
};
+ constructor(props: Props) {
+ super(props);
+ this.state = { query: '', selected: null };
+ }
+
componentDidMount() {
window.addEventListener('click', this.handleClickOutside);
}