@7shifts/sous-chef 3.36.1 → 3.36.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.
package/dist/index.js CHANGED
@@ -5775,13 +5775,6 @@ var getItemType = function getItemType(child) {
5775
5775
  }
5776
5776
  throw new Error('DropdownList - dropdown items should be using DropdownListDivider or DropdownListItem components');
5777
5777
  };
5778
- var calculateScrollYPosition = function calculateScrollYPosition(newFocusItem, lastFocusItem, paneScrollTop, maxPaneHeight, elementYPosition) {
5779
- var directionCoeff = !lastFocusItem || newFocusItem > lastFocusItem ? -1 * maxPaneHeight : 0;
5780
- if (elementYPosition > paneScrollTop + maxPaneHeight || elementYPosition < paneScrollTop) {
5781
- return elementYPosition + directionCoeff;
5782
- }
5783
- return null;
5784
- };
5785
5778
 
5786
5779
  var DropdownList = function DropdownList(_ref) {
5787
5780
  var testId = _ref.testId,
@@ -5804,10 +5797,7 @@ var DropdownList = function DropdownList(_ref) {
5804
5797
  if (listRef.current && newFocusItem !== null && listRef.current.parentNode) {
5805
5798
  var element = listRef.current.querySelector(":nth-child(" + (newFocusItem + 1) + ")");
5806
5799
  var parentList = listRef.current.parentNode;
5807
- var scrollYPosition = calculateScrollYPosition(newFocusItem, focusedItem || 0, parentList.scrollTop, 354, element.offsetTop);
5808
- if (scrollYPosition !== null) {
5809
- parentList.scrollTo(0, scrollYPosition);
5810
- }
5800
+ parentList.scrollTo(0, element.offsetTop);
5811
5801
  }
5812
5802
  };
5813
5803
  var _useListKeyboardNavig = useListKeyboardNavigation(items, listRef, {
@@ -9786,7 +9776,7 @@ var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
9786
9776
  allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2H);
9787
9777
  var internalRef = React.useRef(null);
9788
9778
  var ref = forwardedRef || internalRef;
9789
- var _useState = React.useState(allOtherProps.defaultValue),
9779
+ var _useState = React.useState(allOtherProps.value || allOtherProps.defaultValue),
9790
9780
  selectedDropdownValue = _useState[0],
9791
9781
  setSelectedDropdownValue = _useState[1];
9792
9782
  var onOptionClick = function onOptionClick(option) {