diff --git a/ui-v2/app/components/aria-menu.js b/ui-v2/app/components/aria-menu.js
index 50f63afa4d..2c1daff70c 100644
--- a/ui-v2/app/components/aria-menu.js
+++ b/ui-v2/app/components/aria-menu.js
@@ -39,6 +39,7 @@ const MENU_ITEMS = '[role^="menuitem"]';
export default Component.extend({
tagName: '',
dom: service('dom'),
+ router: service('router'),
guid: '',
expanded: false,
orientation: 'vertical',
@@ -47,6 +48,7 @@ export default Component.extend({
this._super(...arguments);
set(this, 'guid', this.dom.guid(this));
this._listeners = this.dom.listeners();
+ this._routelisteners = this.dom.listeners();
},
didInsertElement: function() {
// TODO: How do you detect whether the children have changed?
@@ -54,10 +56,14 @@ export default Component.extend({
this.$menu = this.dom.element(`#${COMPONENT_ID}menu-${this.guid}`);
const labelledBy = this.$menu.getAttribute('aria-labelledby');
this.$trigger = this.dom.element(`#${labelledBy}`);
+ this._routelisteners.add(this.router, {
+ routeWillChange: () => this.actions.close.apply(this, [{}]),
+ });
},
willDestroyElement: function() {
this._super(...arguments);
this._listeners.remove();
+ this._routelisteners.remove();
},
actions: {
keypressClick: function(e) {
diff --git a/ui-v2/app/templates/components/hashicorp-consul.hbs b/ui-v2/app/templates/components/hashicorp-consul.hbs
index 37d73e1e5a..f6f844b717 100644
--- a/ui-v2/app/templates/components/hashicorp-consul.hbs
+++ b/ui-v2/app/templates/components/hashicorp-consul.hbs
@@ -12,7 +12,7 @@
{{#if dc}}
{{#if (and (env 'CONSUL_NSPACES_ENABLED') (gt nspaces.length 0))}}
- -
+
-
{{#if (and (eq nspaces.length 1) (not canManageNspaces)) }}
{{nspace.Name}}
{{ else }}
diff --git a/ui-v2/app/templates/components/popover-menu.hbs b/ui-v2/app/templates/components/popover-menu.hbs
index e6d31a34aa..9b7b4721f4 100644
--- a/ui-v2/app/templates/components/popover-menu.hbs
+++ b/ui-v2/app/templates/components/popover-menu.hbs
@@ -1,6 +1,6 @@
{{yield (concat 'popover-menu-' guid)}}
{{#aria-menu keyboardAccess=keyboardAccess as |change keypress ariaLabelledBy ariaControls ariaExpanded keypressClick|}}
- {{#toggle-button checked=expanded onchange=(queue change (action 'change')) as |click|}}
+ {{#toggle-button checked=ariaExpanded onchange=(queue change (action 'change')) as |click|}}