FIX: ensures popover is hidden when changing route (#7300)

FIX: ensures popover is hidden when changing route (#7300)

diff --git a/app/assets/javascripts/discourse/initializers/d-popover.js.es6 b/app/assets/javascripts/discourse/initializers/d-popover.js.es6
index 0fae353..d27837d 100644
--- a/app/assets/javascripts/discourse/initializers/d-popover.js.es6
+++ b/app/assets/javascripts/discourse/initializers/d-popover.js.es6
@@ -6,7 +6,10 @@ const SELECTORS =
 export default {
   name: "d-popover",
 
-  initialize() {
+  initialize(container) {
+    const router = container.lookup("router:main");
+    router.on("routeWillChange", hidePopover);
+
     $("#main").on("click.d-popover mouseenter.d-popover", SELECTORS, event =>
       showPopover(event)
     );

GitHub sha: 13a6a04c

1 Like