commit: 71b5462a059708e036bd2c998758e8fa1e205450
parent e3b9c00d5e1bfadc0e1e1bcd06c43cf53035f0c0
Author: Henry Jameson <me@hjkos.com>
Date: Wed, 8 Jun 2022 03:22:50 +0300
vPadding is no longer needed
Diffstat:
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
@@ -109,16 +109,10 @@ const Popover = {
if (origin.y + content.offsetHeight > yBounds.max) usingTop = true
if (origin.y - content.offsetHeight < yBounds.min) usingTop = false
- let vPadding = 0
- if (this.removePadding && usingTop) {
- const anchorStyle = getComputedStyle(anchorEl)
- vPadding = parseFloat(anchorStyle.paddingTop) + parseFloat(anchorStyle.paddingBottom)
- }
-
const yOffset = (this.offset && this.offset.y) || 0
const translateY = usingTop
- ? yOffset - content.offsetHeight - vPadding
- : yOffset + anchorHeight + vPadding
+ ? yOffset - content.offsetHeight
+ : yOffset + anchorHeight
const xOffset = (this.offset && this.offset.x) || 0
const translateX = horizOffset + xOffset