@jetbrains/ring-ui 6.0.82 → 6.0.83
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDocumentScrollLeft, getDocumentScrollTop, getRect,
|
|
1
|
+
import { getDocumentScrollLeft, getDocumentScrollTop, getRect, isMounted } from '../global/dom';
|
|
2
2
|
import { Dimension, Directions, MaxHeight, MinWidth } from './popup.consts';
|
|
3
3
|
export { Dimension, Directions, MaxHeight, MinWidth };
|
|
4
4
|
function getScrollingCoordinates(container) {
|
|
@@ -42,7 +42,7 @@ function getPositionStyles(popup, anchorRect, anchorLeft, anchorTop, offset) {
|
|
|
42
42
|
function verticalOverflow(styles, scrollingCoordinates, attrs) {
|
|
43
43
|
const containerHeight = attrs.container !== null
|
|
44
44
|
? attrs.container.clientHeight
|
|
45
|
-
:
|
|
45
|
+
: document.documentElement.clientHeight;
|
|
46
46
|
const viewportMinX = scrollingCoordinates.top + attrs.sidePadding;
|
|
47
47
|
const viewportMaxX = scrollingCoordinates.top + containerHeight - attrs.sidePadding;
|
|
48
48
|
const topOverflow = Math.max(viewportMinX - styles.top, 0);
|
|
@@ -52,7 +52,9 @@ function verticalOverflow(styles, scrollingCoordinates, attrs) {
|
|
|
52
52
|
return topOverflow + bottomOverflow;
|
|
53
53
|
}
|
|
54
54
|
function horizontalOverflow(styles, scrollingCoordinates, attrs) {
|
|
55
|
-
const containerWidth = attrs.container !== null
|
|
55
|
+
const containerWidth = attrs.container !== null
|
|
56
|
+
? attrs.container.clientWidth
|
|
57
|
+
: document.documentElement.clientWidth;
|
|
56
58
|
const viewportMinY = scrollingCoordinates.left + attrs.sidePadding;
|
|
57
59
|
const viewportMaxY = scrollingCoordinates.left + containerWidth - attrs.sidePadding;
|
|
58
60
|
const leftOverflow = Math.max(viewportMinY - styles.left, 0);
|