@7shifts/sous-chef 3.44.5 → 3.44.6

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
@@ -6363,15 +6363,20 @@ var PaneOverlay = function PaneOverlay(_ref) {
6363
6363
  position = _useState[0],
6364
6364
  setPosition = _useState[1];
6365
6365
  React.useEffect(function () {
6366
- var handleScroll = function handleScroll() {
6367
- console.log('Scrolling 2');
6368
- onToggleDropdown();
6366
+ var handleScroll = function handleScroll(e) {
6367
+ var _paneRef$current;
6368
+ if (e.target !== paneRef.current && !((_paneRef$current = paneRef.current) !== null && _paneRef$current !== void 0 && _paneRef$current.contains(e.target))) {
6369
+ console.log('Is not scrolling inside the pane');
6370
+ onToggleDropdown();
6371
+ } else {
6372
+ console.log('Is scrolling inside the pane');
6373
+ }
6369
6374
  };
6370
6375
  window.addEventListener('scroll', handleScroll, true);
6371
6376
  return function () {
6372
6377
  window.removeEventListener('scroll', handleScroll, true);
6373
6378
  };
6374
- }, [onToggleDropdown]);
6379
+ }, [onToggleDropdown, paneRef]);
6375
6380
  useOnClickOutsideRole('dialog', onToggleDropdown);
6376
6381
  React.useLayoutEffect(function () {
6377
6382
  if (!triggerRef || !('current' in triggerRef) || !(triggerRef !== null && triggerRef !== void 0 && triggerRef.current) || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {