@aiaiai-pt/design-system 0.51.1 → 0.51.2
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.
|
@@ -62,6 +62,12 @@
|
|
|
62
62
|
|
|
63
63
|
const rect = anchor.getBoundingClientRect();
|
|
64
64
|
const popRect = popoverEl.getBoundingClientRect();
|
|
65
|
+
// Natural height, not the rendered box: once capped, the box reads the cap,
|
|
66
|
+
// which always "fits", and the cap would drop on the next reposition (the
|
|
67
|
+
// capture scroll listener fires when the popover's own content scrolls).
|
|
68
|
+
// scrollHeight is the content height; the rest of the box is its borders.
|
|
69
|
+
const naturalHeight =
|
|
70
|
+
popoverEl.scrollHeight + (popRect.height - popoverEl.clientHeight);
|
|
65
71
|
const viewportH = window.innerHeight;
|
|
66
72
|
const viewportW = window.innerWidth;
|
|
67
73
|
|
|
@@ -71,7 +77,7 @@
|
|
|
71
77
|
|
|
72
78
|
const { x, y, maxHeight } = calculatePopoverPosition(
|
|
73
79
|
rect,
|
|
74
|
-
{ width: popRect.width, height:
|
|
80
|
+
{ width: popRect.width, height: naturalHeight },
|
|
75
81
|
viewportH,
|
|
76
82
|
viewportW,
|
|
77
83
|
placement,
|