volto-dropdownmenu 2.4.2 → 2.4.3

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/CHANGELOG.md CHANGED
@@ -4,10 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v2.4.3](https://github.com/collective/volto-dropdownmenu/compare/v2.4.3...v2.4.3)
8
+
9
+ > 31 August 2022
10
+
11
+ - fix: a11y handle dropdown navigation [`67e97c1`](https://github.com/collective/volto-dropdownmenu/commit/67e97c1947e6a392e82c3104b5797a9c7680812f)
12
+ - chore: rollback 2.4.3 release [`07b437b`](https://github.com/collective/volto-dropdownmenu/commit/07b437b365aaabc5a05e4d7adb7086f50186b3bc)
13
+
14
+ #### [v2.4.3](https://github.com/collective/volto-dropdownmenu/compare/v2.4.2...v2.4.3)
15
+
16
+ > 31 August 2022
17
+
18
+ - fix: a11y handle dropdown navigation [`b8304c1`](https://github.com/collective/volto-dropdownmenu/commit/b8304c1990698e0c957679edadeb58a18ffc539d)
19
+ - Release 2.4.3 [`b0f92e7`](https://github.com/collective/volto-dropdownmenu/commit/b0f92e7af65952ae5bcff29bde97c3edb9edf6af)
20
+
7
21
  #### [v2.4.2](https://github.com/collective/volto-dropdownmenu/compare/v2.4.1...v2.4.2)
8
22
 
9
23
  > 25 May 2022
10
24
 
25
+ - Release 2.4.2 [`0cb2f7c`](https://github.com/collective/volto-dropdownmenu/commit/0cb2f7c2faf7735f44e9f37764c821f7b7ddd8b0)
11
26
  - feat: added mobile-menu-opend class to body when mobile menu is opened [`659960c`](https://github.com/collective/volto-dropdownmenu/commit/659960c07782af2b0fe7d0686029bfea2ee0bac2)
12
27
 
13
28
  #### [v2.4.1](https://github.com/collective/volto-dropdownmenu/compare/v2.4.0...v2.4.1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volto-dropdownmenu",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Volto addon for a customizable dropdown menu",
5
5
  "main": "src/index.js",
6
6
  "repository": "https://github.com/collective/volto-dropdownmenu.git",
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { NavLink, useLocation } from 'react-router-dom';
3
3
  import { defineMessages, useIntl } from 'react-intl';
4
4
  import { Segment, Container, Icon, Grid, Button } from 'semantic-ui-react';
@@ -48,6 +48,24 @@ const DropdownMenu = ({ menu, open = false, closeMenu }) => {
48
48
  }
49
49
  }
50
50
 
51
+ const lastLinkEventListener = (e) => {
52
+ if (e.code === 'Tab') {
53
+ document
54
+ .querySelector(
55
+ '.dropdown-menu-wrapper.open button.dropdown-close-button',
56
+ )
57
+ .focus();
58
+ }
59
+ };
60
+
61
+ useEffect(() => {
62
+ const links = document.querySelectorAll('.dropdown-menu-wrapper.open a');
63
+ const lastLink = links[links.length - 1];
64
+ if (lastLink) {
65
+ lastLink.addEventListener('keydown', lastLinkEventListener);
66
+ }
67
+ });
68
+
51
69
  return (
52
70
  <div
53
71
  className={cx('dropdown-menu-wrapper', {