take into account paddingRight

This commit is contained in:
ngxson
2020-07-22 19:09:21 +02:00
parent b7383ea670
commit 58728e24db
+3 -1
View File
@@ -95,6 +95,7 @@ const InputTools = {
// get dimension & position of anchor
const anchorCoords = anchor.getBoundingClientRect();
const anchorStyle = getComputedStyle(anchor);
const elemWidth = InputTools.dimensionToInt(elem.style.width);
const pageXOffset = isFixed ? 0 : window.pageXOffset;
const pageYOffset = isFixed ? 0 : window.pageYOffset;
@@ -108,7 +109,8 @@ const InputTools = {
anchorCoords.left +
pageXOffset +
anchor.offsetWidth +
buttonXOffset +
buttonXOffset -
InputTools.dimensionToInt(anchorStyle.paddingRight) +
"px";
const top = anchorCoords.top + pageYOffset + "px";