@patternfly/quickstarts 6.0.0-prerelease.3 → 6.0.0-prerelease.4
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.
|
@@ -6535,7 +6535,7 @@ const MenuList = (_a) => {
|
|
|
6535
6535
|
MenuList.displayName = 'MenuList';
|
|
6536
6536
|
|
|
6537
6537
|
const SelectBase = (_a) => {
|
|
6538
|
-
var { children, className, onSelect, isOpen, selected, toggle, shouldFocusToggleOnSelect = false, shouldFocusFirstItemOnOpen =
|
|
6538
|
+
var { children, className, onSelect, isOpen, selected, toggle, shouldFocusToggleOnSelect = false, shouldFocusFirstItemOnOpen = false, onOpenChange, onOpenChangeKeys = ['Escape', 'Tab'], isPlain, innerRef, zIndex = 9999, role = 'listbox', popperProps, menuHeight, maxMenuHeight, isScrollable, shouldPreventScrollOnItemFocus = true, focusTimeoutDelay = 0 } = _a, props = __rest$1(_a, ["children", "className", "onSelect", "isOpen", "selected", "toggle", "shouldFocusToggleOnSelect", "shouldFocusFirstItemOnOpen", "onOpenChange", "onOpenChangeKeys", "isPlain", "innerRef", "zIndex", "role", "popperProps", "menuHeight", "maxMenuHeight", "isScrollable", "shouldPreventScrollOnItemFocus", "focusTimeoutDelay"]);
|
|
6539
6539
|
const localMenuRef = React__default.useRef();
|
|
6540
6540
|
const localToggleRef = React__default.useRef();
|
|
6541
6541
|
const menuRef = innerRef || localMenuRef;
|
|
@@ -6549,8 +6549,8 @@ const SelectBase = (_a) => {
|
|
|
6549
6549
|
setTimeout(() => {
|
|
6550
6550
|
var _a;
|
|
6551
6551
|
const firstElement = (_a = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('li button:not(:disabled),li input:not(:disabled)');
|
|
6552
|
-
firstElement && firstElement.focus();
|
|
6553
|
-
},
|
|
6552
|
+
firstElement && firstElement.focus({ preventScroll: shouldPreventScrollOnItemFocus });
|
|
6553
|
+
}, focusTimeoutDelay);
|
|
6554
6554
|
}
|
|
6555
6555
|
prevIsOpen.current = isOpen;
|
|
6556
6556
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -6584,7 +6584,16 @@ const SelectBase = (_a) => {
|
|
|
6584
6584
|
window.removeEventListener('keydown', handleMenuKeys);
|
|
6585
6585
|
window.removeEventListener('click', handleClick);
|
|
6586
6586
|
};
|
|
6587
|
-
}, [
|
|
6587
|
+
}, [
|
|
6588
|
+
isOpen,
|
|
6589
|
+
menuRef,
|
|
6590
|
+
toggleRef,
|
|
6591
|
+
onOpenChange,
|
|
6592
|
+
onOpenChangeKeys,
|
|
6593
|
+
shouldPreventScrollOnItemFocus,
|
|
6594
|
+
shouldFocusFirstItemOnOpen,
|
|
6595
|
+
focusTimeoutDelay
|
|
6596
|
+
]);
|
|
6588
6597
|
const menu = (React__default.createElement(Menu, Object.assign({ role: role, className: css(className), ref: menuRef, onSelect: (event, value) => {
|
|
6589
6598
|
onSelect && onSelect(event, value);
|
|
6590
6599
|
shouldFocusToggleOnSelect && toggleRef.current.focus();
|