forstok-ui-lib 5.8.7 → 5.8.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.8.7",
3
+ "version": "5.8.9",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -22,8 +22,12 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
22
22
 
23
23
  const evResetDropdown = () => {
24
24
  const containerRef = document.getElementsByClassName('_refContainer is-shown') as HTMLCollectionOf<HTMLElement>;
25
+ const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
25
26
  if (containerRef.length) {
27
+ bodyEl.classList.remove('is-immuned');
26
28
  for (let i = 0; i < containerRef.length; i++) {
29
+ const overlayEl = containerRef[i].querySelector(`._refDropdownOverlay`) as HTMLDivElement;
30
+ overlayEl.style.display = 'none';
27
31
  containerRef[i].classList.remove('is-shown');
28
32
  }
29
33
  }
@@ -51,12 +55,16 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
51
55
  return;
52
56
  }
53
57
  const containerEl = buttonEl.closest('._refContainer') as HTMLElement;
58
+ const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
54
59
  if (containerEl) {
60
+ const overlayEl = containerEl.querySelector(`._refDropdownOverlay`) as HTMLDivElement;
55
61
  const isCurOpen = containerEl.classList.contains('is-shown');
56
62
  const offsetPos = containerEl.getBoundingClientRect();
57
63
 
58
64
  if (!isCurOpen) {
59
65
  evResetDropdown();
66
+ overlayEl.style.display = 'block';
67
+ bodyEl.classList.add('is-immuned');
60
68
  containerEl.classList.add('is-shown');
61
69
  setTimeout(() => {
62
70
  if (portalId) {
@@ -84,6 +92,8 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
84
92
  }, 10);
85
93
  onClick && onClick(e);
86
94
  } else {
95
+ overlayEl.style.display = 'none';
96
+ bodyEl.classList.remove('is-immuned');
87
97
  containerEl.classList.remove('is-shown');
88
98
  setTimeout(() => {
89
99
  if (portalId) {