diff --git a/CHANGELOG.md b/CHANGELOG.md index b5af0c7e..39f386e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ For full details, see the documentation at [https://picmojs.com](https://picmojs.com). +## [5.0.1] - 2022-05-18 + +### Changed + +- Fixed exception being thrown when opening a popup picker with `showCloseButton: false` set. + ## [5.0.0] - 2022-05-15 First PicMo release (previously Emoji Button). diff --git a/packages/popup-picker/src/popupPicker.ts b/packages/popup-picker/src/popupPicker.ts index 85c19013..c7aeff0e 100644 --- a/packages/popup-picker/src/popupPicker.ts +++ b/packages/popup-picker/src/popupPicker.ts @@ -237,17 +237,19 @@ export class PopupPickerController { } private animateCloseButton(openState: boolean) { - return animate(this.closeButton, { - opacity: [0, 1] - }, - { - duration: 25, - id: openState ? 'show-close' : 'hide-close', - easing: 'ease-in-out', - direction: openState ? 'normal' : 'reverse', - fill: 'both', - }, - this.options) + if (this.closeButton) { + return animate(this.closeButton, { + opacity: [0, 1] + }, + { + duration: 25, + id: openState ? 'show-close' : 'hide-close', + easing: 'ease-in-out', + direction: openState ? 'normal' : 'reverse', + fill: 'both', + }, + this.options); + } } /**