@doyourjob/gravity-ui-page-constructor-addons 2.1.11 → 2.1.13

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.
@@ -42,7 +42,7 @@ const Navigation = ({ data, headerRef, handleOpenPopup, handleClosePopup, withBa
42
42
  if (event.key === 'Escape') {
43
43
  setActiveTab(constants_1.NO_MENU_TAB_SELECTED);
44
44
  setPretendentAciveTab(constants_1.NO_MENU_TAB_SELECTED);
45
- previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus();
45
+ previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus({ preventScroll: true });
46
46
  }
47
47
  }, [previouslyFocusedElement]);
48
48
  (0, react_1.useEffect)(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
@@ -49,6 +49,7 @@ function FocusTrap({ children, enabled = true, disableAutoFocus, autoFocus = tru
49
49
  escapeDeactivates: false,
50
50
  clickOutsideDeactivates: false,
51
51
  allowOutsideClick: true,
52
+ preventScroll: true,
52
53
  });
53
54
  }
54
55
  updateContainerElements();
@@ -39,7 +39,7 @@ export const Navigation = ({ data, headerRef, handleOpenPopup, handleClosePopup,
39
39
  if (event.key === 'Escape') {
40
40
  setActiveTab(NO_MENU_TAB_SELECTED);
41
41
  setPretendentAciveTab(NO_MENU_TAB_SELECTED);
42
- previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus();
42
+ previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus({ preventScroll: true });
43
43
  }
44
44
  }, [previouslyFocusedElement]);
45
45
  useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
@@ -45,6 +45,7 @@ export function FocusTrap({ children, enabled = true, disableAutoFocus, autoFocu
45
45
  escapeDeactivates: false,
46
46
  clickOutsideDeactivates: false,
47
47
  allowOutsideClick: true,
48
+ preventScroll: true,
48
49
  });
49
50
  }
50
51
  updateContainerElements();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doyourjob/gravity-ui-page-constructor-addons",
3
- "version": "2.1.11",
3
+ "version": "2.1.13",
4
4
  "description": "Components and plugins for @doyourjob/gravity-ui-page-constructor",
5
5
  "license": "MIT",
6
6
  "repository": {