Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always open popup with single click #398

Merged
merged 1 commit into from
Sep 13, 2021
Merged

fix: always open popup with single click #398

merged 1 commit into from
Sep 13, 2021

Conversation

turban
Copy link
Collaborator

@turban turban commented Sep 12, 2021

This PR fixes an issue where it is not possible to open a new popup while another is open. You need to click twice, first to close the popup that is currently open, then to open a new one.

The problem is that the mapping library is calling the onClose handler of the previous popup when a new popup is created, even though the same popup is reused. The fix is to detach the onClose handler when the popup is created, and then attach it again afterwards.

After this PR opening popups are much quicker:

popup

@turban turban merged commit bd2b9ac into master Sep 13, 2021
@turban turban deleted the fix/popup-close branch September 13, 2021 10:57
dhis2-bot added a commit that referenced this pull request Sep 13, 2021
## [2.1.2](v2.1.1...v2.1.2) (2021-09-13)

### Bug Fixes

* always open popup with single click ([#398](#398)) ([bd2b9ac](bd2b9ac))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants