@via-profit/ui-kit 0.1.0-rc.33 → 0.1.0-rc.35
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.
|
@@ -17,6 +17,10 @@ const ModalWrapper = props => {
|
|
|
17
17
|
var _a;
|
|
18
18
|
const outer = window.document.createElement('div');
|
|
19
19
|
const inner = window.document.createElement('div');
|
|
20
|
+
const isVerticalScrollbar = window.document.body.scrollHeight > window.document.body.clientHeight;
|
|
21
|
+
if (!isVerticalScrollbar) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
20
24
|
let widthNoScroll = 0;
|
|
21
25
|
let widthWithScroll = 0;
|
|
22
26
|
outer.style.visibility = 'hidden';
|
|
@@ -81,7 +85,7 @@ const ModalWrapper = props => {
|
|
|
81
85
|
containerRef.current.focus();
|
|
82
86
|
}
|
|
83
87
|
const keydown = (event) => {
|
|
84
|
-
if (event.key.toLowerCase() !== 'tab') {
|
|
88
|
+
if (event.key.toLowerCase() !== 'tab' || !isOpenProp) {
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
87
91
|
event.preventDefault();
|
|
@@ -95,7 +99,7 @@ const ModalWrapper = props => {
|
|
|
95
99
|
}
|
|
96
100
|
window.document.removeEventListener('keydown', keydown);
|
|
97
101
|
};
|
|
98
|
-
}, [nextFocus]);
|
|
102
|
+
}, [nextFocus, isOpenProp]);
|
|
99
103
|
/**
|
|
100
104
|
* Component will unmount
|
|
101
105
|
* Mark component as unmounted
|