diff --git a/CHANGELOG.md b/CHANGELOG.md index ab978d2d..7d45c467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Fixed missing special groups `authors` and `defaults` for pages * Fixed Page Move action and selection highlight in Parents selector modal [flex-objects#80](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/80) * Fixed folder auto-naming in Add Module [#1937](https://github.com/getgrav/grav-plugin-admin/issues/1937) + * Fixed remodal issue triggering close when selecting a dropdown item ending outside of scope [#1682](https://github.com/getgrav/grav-plugin-admin/issues/1682) # v1.10.0-rc.17 ## 10/07/2020 diff --git a/themes/grav/app/utils/remodal.js b/themes/grav/app/utils/remodal.js index fbf4d63f..39a13c39 100644 --- a/themes/grav/app/utils/remodal.js +++ b/themes/grav/app/utils/remodal.js @@ -589,8 +589,10 @@ import $ from 'jquery'; // Add the event listener for the overlay remodal.$wrapper.on('click.' + NAMESPACE, function(e) { var $target = $(e.target); + var isWrapper = $target.hasClass(namespacify('wrapper')); + var isWithin = $target.closest('.' + namespacify('is', STATES.OPENED)).length; - if (!$target.hasClass(namespacify('wrapper'))) { + if (!isWrapper && isWithin) { return; }