Skip to content

Commit

Permalink
Cleanup popup tip on popup removal (#5564)
Browse files Browse the repository at this point in the history
* chore: cleanup leftover popup tip when popup is removed

* chore: changelog

* chore: clean-up event listeners on popup removal

* chore: change changelog

* chore: move close button removeEventListener outside this._map if

* chore: remove popup test
  • Loading branch information
kamil-sienkiewicz-asi authored Feb 28, 2025
1 parent 1dc7c91 commit 67b7f03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### 🐞 Bug fixes

- _...Add new stuff here..._
- Remove closeButton event listener on popup.remove().

## 5.1.1

Expand Down
4 changes: 4 additions & 0 deletions src/ui/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ export class Popup extends Evented {
delete this._container;
}

if(this._closeButton){
this._closeButton.removeEventListener('click', this._onClose);
}

if (this._map) {
this._map.off('move', this._update);
this._map.off('move', this._onClose);
Expand Down

0 comments on commit 67b7f03

Please sign in to comment.