Skip to content

Commit

Permalink
FFE_147 Remove event listeners on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
Alf Bjørn Hustoft committed Feb 8, 2017
1 parent 616f9db commit f6292a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v2.0.9
* Remove event listeners on unmount

## v2.0.8
* Fix focus/click bug which made it possible to keep several calendars open when having more than one datepicker on the same page

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffe-datepicker-react",
"version": "2.0.8",
"version": "2.0.9",
"main": "lib/ffe-datepicker-react.js",
"scripts": {
"build": "babel -d lib/. --ignore=*.test.js src/.",
Expand Down
4 changes: 4 additions & 0 deletions src/datepicker/ffe-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default class FFEDatepicker extends React.Component {
this.onInputBlur = this.onInputBlur.bind(this);
}

componentWillUnmount() {
this.removeGlobalEventListeners();
}

onInputFocus() {
if (this.state.openOnFocus) {
this.openCalendar();
Expand Down

0 comments on commit f6292a4

Please sign in to comment.