@pushwoosh/dumb-components 1.1.56 → 1.1.58

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.
@@ -66,7 +66,7 @@ export const CalendarDropdown = props => {
66
66
  open: isOpen,
67
67
  anchorEl: buttonRef,
68
68
  internalWindowRef: popoverRef,
69
- windowWidth: 500,
69
+ windowWidth: isRangePicker ? 500 : 260,
70
70
  position: "bottom-start",
71
71
  zIndex: 10010
72
72
  }, React.createElement(PopoverContent, {
@@ -45,6 +45,16 @@ export const DropdownMenu = ({
45
45
  };
46
46
  }
47
47
  }, [isOpen, refs.floating, refs.reference]);
48
+ useEffect(() => {
49
+ if (isOpen && isScrollable && refs.floating.current) {
50
+ const activeElement = refs.floating.current.querySelector('[data-active="true"]');
51
+ if (activeElement) {
52
+ activeElement.scrollIntoView({
53
+ block: 'nearest'
54
+ });
55
+ }
56
+ }
57
+ }, [isOpen, isScrollable, refs.floating]);
48
58
  return React.createElement(DropdownContext.Provider, {
49
59
  value: setIsOpen
50
60
  }, renderHandler({
@@ -24,6 +24,7 @@ export const DropdownMenuItem = ({
24
24
  }
25
25
  onClick();
26
26
  },
27
- disabled: disabled
27
+ disabled: disabled,
28
+ "data-active": isActive || undefined
28
29
  }, children);
29
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",