@patternfly/react-core 4.242.7 → 4.242.8

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
  3. package/dist/esm/components/Menu/Menu.js +1 -1
  4. package/dist/esm/components/Menu/Menu.js.map +1 -1
  5. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  6. package/dist/esm/components/Select/Select.js +4 -1
  7. package/dist/esm/components/Select/Select.js.map +1 -1
  8. package/dist/js/components/Menu/Menu.d.ts.map +1 -1
  9. package/dist/js/components/Menu/Menu.js +1 -1
  10. package/dist/js/components/Menu/Menu.js.map +1 -1
  11. package/dist/js/components/Select/Select.d.ts.map +1 -1
  12. package/dist/js/components/Select/Select.js +4 -1
  13. package/dist/js/components/Select/Select.js.map +1 -1
  14. package/dist/umd/react-core.min.css +937 -937
  15. package/dist/umd/react-core.min.js +2 -2
  16. package/package.json +2 -2
  17. package/src/components/Menu/Menu.tsx +3 -1
  18. package/src/components/Select/Select.tsx +7 -1
  19. package/src/demos/ComposableMenu/examples/ComposableActionsMenu.tsx +1 -1
  20. package/src/demos/ComposableMenu/examples/ComposableApplicationLauncher.tsx +3 -1
  21. package/src/demos/ComposableMenu/examples/ComposableContextSelector.tsx +3 -1
  22. package/src/demos/ComposableMenu/examples/ComposableDrilldownMenu.tsx +1 -1
  23. package/src/demos/ComposableMenu/examples/ComposableDropdwnVariants.tsx +3 -1
  24. package/src/demos/ComposableMenu/examples/ComposableFlyout.tsx +1 -1
  25. package/src/demos/ComposableMenu/examples/ComposableOptionsMenuVariants.tsx +3 -1
  26. package/src/demos/ComposableMenu/examples/ComposableSimpleCheckboxSelect.tsx +1 -1
  27. package/src/demos/ComposableMenu/examples/ComposableSimpleDropdown.tsx +1 -1
  28. package/src/demos/ComposableMenu/examples/ComposableSimpleSelect.tsx +1 -1
  29. package/src/demos/ComposableMenu/examples/ComposableTreeViewMenu.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.242.7",
3
+ "version": "4.242.8",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -70,5 +70,5 @@
70
70
  "react": "^16.8 || ^17 || ^18",
71
71
  "react-dom": "^16.8 || ^17 || ^18"
72
72
  },
73
- "gitHead": "490a8d50cdf86999effdf59eca4ab3b7bf0c01eb"
73
+ "gitHead": "13e7bc690a3e25b2a6c14b2a4fef153fff2b70cb"
74
74
  }
@@ -101,7 +101,9 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
101
101
  // Allow tabbing to first menu item
102
102
  const current = this.menuRef.current;
103
103
  if (current) {
104
- const first = current.querySelector('ul button, ul a') as HTMLButtonElement | HTMLAnchorElement;
104
+ const first = current.querySelector('ul button:not(:disabled), ul a:not(:disabled)') as
105
+ | HTMLButtonElement
106
+ | HTMLAnchorElement;
105
107
  if (first) {
106
108
  first.tabIndex = 0;
107
109
  }
@@ -283,7 +283,13 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
283
283
 
284
284
  // Move focus to top of the menu if state.focusFirstOption was updated to true and the menu does not have custom content
285
285
  if (!prevState.focusFirstOption && this.state.focusFirstOption && !this.props.customContent) {
286
- const firstRef = this.refCollection.find(ref => ref !== null);
286
+ const firstRef = this.refCollection.find(
287
+ ref =>
288
+ // If a select option is disabled then ref[0] will be undefined, so we want to return
289
+ // the first ref that both a) is not null and b) is not disabled.
290
+ ref !== null && ref[0]
291
+ );
292
+
287
293
  if (firstRef && firstRef[0]) {
288
294
  firstRef[0].focus();
289
295
  }
@@ -52,7 +52,7 @@ export const ComposableActionsMenu: React.FunctionComponent = () => {
52
52
  ev.stopPropagation(); // Stop handleClickOutside from handling
53
53
  setTimeout(() => {
54
54
  if (menuRef.current) {
55
- const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
55
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
56
56
  firstElement && (firstElement as HTMLElement).focus();
57
57
  }
58
58
  }, 0);
@@ -47,7 +47,9 @@ export const ComposableApplicationLauncher: React.FunctionComponent = () => {
47
47
  ev.stopPropagation(); // Stop handleClickOutside from handling
48
48
  setTimeout(() => {
49
49
  if (menuRef.current) {
50
- const firstElement = menuRef.current.querySelector('li > button,input:not(:disabled)');
50
+ const firstElement = menuRef.current.querySelector(
51
+ 'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
52
+ );
51
53
  firstElement && (firstElement as HTMLElement).focus();
52
54
  setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])')));
53
55
  }
@@ -103,7 +103,9 @@ export const ComposableContextSelector: React.FunctionComponent = () => {
103
103
  ev.stopPropagation(); // Stop handleClickOutside from handling
104
104
  setTimeout(() => {
105
105
  if (menuRef.current) {
106
- const firstElement = menuRef.current.querySelector('li > button,input:not(:disabled)');
106
+ const firstElement = menuRef.current.querySelector(
107
+ 'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
108
+ );
107
109
  firstElement && (firstElement as HTMLElement).focus();
108
110
  }
109
111
  }, 0);
@@ -56,7 +56,7 @@ export const ComposableDrilldownMenu: React.FunctionComponent = () => {
56
56
  ev.stopPropagation(); // Stop handleClickOutside from handling
57
57
  setTimeout(() => {
58
58
  if (menuRef.current) {
59
- const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
59
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
60
60
  firstElement && (firstElement as HTMLElement).focus();
61
61
  }
62
62
  }, 0);
@@ -58,7 +58,9 @@ export const ComposableDropdwnVariants: React.FunctionComponent = () => {
58
58
  ev.stopPropagation(); // Stop handleClickOutside from handling
59
59
  setTimeout(() => {
60
60
  if (menuRef.current) {
61
- const firstElement = menuRef.current.querySelector('li > button,input:not(:disabled),a');
61
+ const firstElement = menuRef.current.querySelector(
62
+ 'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
63
+ );
62
64
  firstElement && (firstElement as HTMLElement).focus();
63
65
  }
64
66
  }, 0);
@@ -72,7 +72,7 @@ export const ComposableFlyout: React.FunctionComponent = () => {
72
72
  ev.stopPropagation(); // Stop handleClickOutside from handling
73
73
  setTimeout(() => {
74
74
  if (menuRef.current) {
75
- const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
75
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
76
76
  firstElement && (firstElement as HTMLElement).focus();
77
77
  }
78
78
  }, 0);
@@ -37,7 +37,9 @@ export const ComposableOptionsMenuVariants: React.FunctionComponent = () => {
37
37
  ev.stopPropagation(); // Stop handleClickOutside from handling
38
38
  setTimeout(() => {
39
39
  if (menuRef.current) {
40
- const firstElement = menuRef.current.querySelector('li > button,input:not(:disabled)');
40
+ const firstElement = menuRef.current.querySelector(
41
+ 'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
42
+ );
41
43
  firstElement && (firstElement as HTMLElement).focus();
42
44
  }
43
45
  }, 0);
@@ -43,7 +43,7 @@ export const ComposableSimpleCheckboxSelect: React.FunctionComponent = () => {
43
43
  ev.stopPropagation(); // Stop handleClickOutside from handling
44
44
  setTimeout(() => {
45
45
  if (menuRef.current) {
46
- const firstElement = menuRef.current.querySelector('li input:not(:disabled)');
46
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
47
47
  firstElement && (firstElement as HTMLElement).focus();
48
48
  }
49
49
  }, 0);
@@ -38,7 +38,7 @@ export const ComposableSimpleDropdown: React.FunctionComponent = () => {
38
38
  ev.stopPropagation(); // Stop handleClickOutside from handling
39
39
  setTimeout(() => {
40
40
  if (menuRef.current) {
41
- const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
41
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
42
42
  firstElement && (firstElement as HTMLElement).focus();
43
43
  }
44
44
  }, 0);
@@ -37,7 +37,7 @@ export const ComposableSimpleSelect: React.FunctionComponent = () => {
37
37
  ev.stopPropagation(); // Stop handleClickOutside from handling
38
38
  setTimeout(() => {
39
39
  if (menuRef.current) {
40
- const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
40
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
41
41
  firstElement && (firstElement as HTMLElement).focus();
42
42
  }
43
43
  }, 0);
@@ -210,7 +210,7 @@ export const ComposableTreeViewMenu: React.FunctionComponent = () => {
210
210
  ev.stopPropagation(); // Stop handleClickOutside from handling
211
211
  setTimeout(() => {
212
212
  if (menuRef.current) {
213
- const firstElement = menuRef.current.querySelector('li button:not(:disabled)');
213
+ const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
214
214
  firstElement && (firstElement as HTMLElement).focus();
215
215
  }
216
216
  }, 0);