@internetarchive/ia-topnav 1.3.5-alpha12 → 1.3.5-alpha13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-topnav",
3
- "version": "1.3.5-alpha12",
3
+ "version": "1.3.5-alpha13",
4
4
  "description": "Top nav for Internet Archive",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "index.js",
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
  export default class KeyboardNavigation {
5
2
  /**
6
3
  * Constructor for the KeyboardNavigation class.
@@ -86,9 +86,14 @@ class PrimaryNav extends TrackedElement {
86
86
  const isUserMenuTab = currentTab && currentTab.mediatype === 'usermenu';
87
87
  if (props.has('currentTab')) {
88
88
  if (isUserMenuTab) {
89
+ const mediaButtons = Array.from(this.shadowRoot.querySelector('media-menu').shadowRoot.querySelectorAll('media-button'));
90
+ const lastMediaButton = mediaButtons.filter(element => {
91
+ return element.shadowRoot.querySelector('a').classList.contains('images')
92
+ });
93
+
89
94
  const focusElement = currentTab.moveTo === 'next'
90
95
  ? this.shadowRoot.querySelector('a.upload')
91
- : this.shadowRoot.querySelector('.user-menu');
96
+ : lastMediaButton[0]?.shadowRoot.querySelector('a.menu-item');
92
97
 
93
98
  if (focusElement) {
94
99
  focusElement.focus();