@doyourjob/gravity-ui-page-constructor-addons 2.1.54 → 2.1.55
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/build/cjs/components/NewHeader/components/NHLoginButton/NHLoginButton.js +4 -1
- package/build/cjs/components/NewHeader/components/NHNavigation/NHNavigation.js +5 -1
- package/build/esm/components/NewHeader/components/NHLoginButton/NHLoginButton.js +4 -1
- package/build/esm/components/NewHeader/components/NHNavigation/NHNavigation.js +5 -1
- package/package.json +1 -1
|
@@ -19,7 +19,10 @@ const NHLoginButton = ({ data, headerRef, setupRouteChangeHandler }) => {
|
|
|
19
19
|
const handleActiveTab = (0, react_1.useCallback)((val) => {
|
|
20
20
|
setPreviouslyFocusedElement(document.activeElement);
|
|
21
21
|
setPretendentAciveTab(val);
|
|
22
|
-
|
|
22
|
+
if (!isActive && val) {
|
|
23
|
+
setIsActive(true);
|
|
24
|
+
}
|
|
25
|
+
}, [isActive]);
|
|
23
26
|
const onEscapeKeyDown = (0, react_1.useCallback)((event) => {
|
|
24
27
|
if (event.key === 'Escape' && isActive) {
|
|
25
28
|
setIsActive(false);
|
|
@@ -33,8 +33,12 @@ const NHNavigation = ({ activeNavigationId, data, headerRef, navigationId, setup
|
|
|
33
33
|
}, [navigationId, setActiveNavigationId]);
|
|
34
34
|
const handleActiveTab = (0, react_1.useCallback)((currentIndex) => {
|
|
35
35
|
setPreviouslyFocusedElement(document.activeElement);
|
|
36
|
+
if (activeTab === constants_1.NO_MENU_TAB_SELECTED && currentIndex !== constants_1.NO_MENU_TAB_SELECTED) {
|
|
37
|
+
setNavigationTab(currentIndex);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
36
40
|
setPretendentAciveTab(currentIndex);
|
|
37
|
-
}, []);
|
|
41
|
+
}, [activeTab, setNavigationTab]);
|
|
38
42
|
const handleToggleTab = (0, react_1.useCallback)((currentIndex) => {
|
|
39
43
|
const focusedElement = document.activeElement;
|
|
40
44
|
const nextActiveTab = activeTab === currentIndex ? constants_1.NO_MENU_TAB_SELECTED : currentIndex;
|
|
@@ -16,7 +16,10 @@ export const NHLoginButton = ({ data, headerRef, setupRouteChangeHandler }) => {
|
|
|
16
16
|
const handleActiveTab = useCallback((val) => {
|
|
17
17
|
setPreviouslyFocusedElement(document.activeElement);
|
|
18
18
|
setPretendentAciveTab(val);
|
|
19
|
-
|
|
19
|
+
if (!isActive && val) {
|
|
20
|
+
setIsActive(true);
|
|
21
|
+
}
|
|
22
|
+
}, [isActive]);
|
|
20
23
|
const onEscapeKeyDown = useCallback((event) => {
|
|
21
24
|
if (event.key === 'Escape' && isActive) {
|
|
22
25
|
setIsActive(false);
|
|
@@ -30,8 +30,12 @@ export const NHNavigation = ({ activeNavigationId, data, headerRef, navigationId
|
|
|
30
30
|
}, [navigationId, setActiveNavigationId]);
|
|
31
31
|
const handleActiveTab = useCallback((currentIndex) => {
|
|
32
32
|
setPreviouslyFocusedElement(document.activeElement);
|
|
33
|
+
if (activeTab === NO_MENU_TAB_SELECTED && currentIndex !== NO_MENU_TAB_SELECTED) {
|
|
34
|
+
setNavigationTab(currentIndex);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
33
37
|
setPretendentAciveTab(currentIndex);
|
|
34
|
-
}, []);
|
|
38
|
+
}, [activeTab, setNavigationTab]);
|
|
35
39
|
const handleToggleTab = useCallback((currentIndex) => {
|
|
36
40
|
const focusedElement = document.activeElement;
|
|
37
41
|
const nextActiveTab = activeTab === currentIndex ? NO_MENU_TAB_SELECTED : currentIndex;
|