aria-ease 1.2.1 → 1.2.2

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.
@@ -0,0 +1,21 @@
1
+ # How You Can Contribute
2
+
3
+ ## For new contributors
4
+
5
+ Create a new branch using format feature e.g add-support-for-input, clean-up-tab-event-listeners e.t.c. That'll be the branch where you can push commits to, and create pull requests from.
6
+
7
+ ## For returning contributors
8
+
9
+ Open a new issue, as detailed as possible. Fix and test issue locally. Create a pull request to dev branch, and await review and/or merge.
10
+
11
+ ## Contribution Guidelines
12
+
13
+ Write all functions in type-safe TypeScript.
14
+
15
+ Test features vigorously, for keyboard and screen reader users.
16
+
17
+ Algorithms must follow best software practices.
18
+
19
+ All functions must be JSDoc documented.
20
+
21
+ All commits must have either format; "fix: fixed event listener perfomance leak" for issues fixing or refactoring, or "build: added ... feature" for creating an entirely new feature that didn't exist before.
package/aria-ease.d.ts CHANGED
@@ -22,9 +22,6 @@ declare module 'aria-ease' {
22
22
  * @param {string} ariaLabel The aria-label to be updated.
23
23
  */
24
24
  function updateMenuTriggerAriaAttributes(triggerId: string, ariaLabel: string): void;
25
-
26
-
27
-
28
25
 
29
26
  export { makeMenuAccessible, makeTabAccessible, updateMenuTriggerAriaAttributes };
30
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Out of the box utility accessibility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,6 +27,7 @@ export function makeMenuAccessible(menuId: string, menuItemClass: string): void
27
27
  switch(event.key) {
28
28
  case 'ArrowUp':
29
29
  case 'ArrowLeft':
30
+ event.preventDefault()
30
31
  if (menuItemIndex === 0) {
31
32
  menuItems.item(menuItems.length - 1).focus();
32
33
  } else {
@@ -35,6 +36,7 @@ export function makeMenuAccessible(menuId: string, menuItemClass: string): void
35
36
  break;
36
37
  case 'ArrowDown':
37
38
  case 'ArrowRight':
39
+ event.preventDefault()
38
40
  if (menuItemIndex === menuItems.length - 1) {
39
41
  menuItems.item(0).focus();
40
42
  } else {
@@ -42,6 +44,7 @@ export function makeMenuAccessible(menuId: string, menuItemClass: string): void
42
44
  }
43
45
  break;
44
46
  case 'Escape':
47
+ event.preventDefault();
45
48
  (getComputedStyle(menuDiv).display === 'block') ?
46
49
  triggerButton.click() :
47
50
  null
@@ -49,6 +52,7 @@ export function makeMenuAccessible(menuId: string, menuItemClass: string): void
49
52
  break;
50
53
  case 'Enter':
51
54
  case ' ':
55
+ event.preventDefault()
52
56
  if(menuItems.item(menuItemIndex).tagName === 'BUTTON') {
53
57
  menuItems.item(menuItemIndex).click()
54
58
  break;
@@ -23,6 +23,7 @@ export function makeTabAccessible(tabId: string, tabItemClass: string): void {
23
23
  switch(event.key) {
24
24
  case 'ArrowUp':
25
25
  case 'ArrowLeft':
26
+ event.preventDefault()
26
27
  if (tabItemIndex === 0) {
27
28
  tabItems.item(tabItems.length - 1).focus();
28
29
  } else {
@@ -31,6 +32,7 @@ export function makeTabAccessible(tabId: string, tabItemClass: string): void {
31
32
  break;
32
33
  case 'ArrowDown':
33
34
  case 'ArrowRight':
35
+ event.preventDefault()
34
36
  if (tabItemIndex === tabItems.length - 1) {
35
37
  tabItems.item(0).focus();
36
38
  } else {
@@ -39,6 +41,7 @@ export function makeTabAccessible(tabId: string, tabItemClass: string): void {
39
41
  break;
40
42
  case 'Enter':
41
43
  case ' ':
44
+ event.preventDefault()
42
45
  if (tabItems.item(tabItemIndex).type === 'radio') {
43
46
  tabItems.item(tabItemIndex).checked = true
44
47
  break;