rc-trigger
Advanced tools
Comparing version 5.3.3 to 5.3.4
@@ -13,5 +13,18 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function measureStretch(element) { | ||
var tgtWidth = element.offsetWidth, | ||
tgtHeight = element.offsetHeight; | ||
var _element$getBoundingC = element.getBoundingClientRect(), | ||
width = _element$getBoundingC.width, | ||
height = _element$getBoundingC.height; // Rect is more accurate than offset, use if near | ||
if (Math.abs(tgtWidth - width) < 1 && Math.abs(tgtHeight - height) < 1) { | ||
tgtWidth = width; | ||
tgtHeight = height; | ||
} | ||
setTargetSize({ | ||
width: element.offsetWidth, | ||
height: element.offsetHeight | ||
width: tgtWidth, | ||
height: tgtHeight | ||
}); | ||
@@ -18,0 +31,0 @@ } // Merge stretch style |
@@ -26,5 +26,18 @@ "use strict"; | ||
function measureStretch(element) { | ||
var tgtWidth = element.offsetWidth, | ||
tgtHeight = element.offsetHeight; | ||
var _element$getBoundingC = element.getBoundingClientRect(), | ||
width = _element$getBoundingC.width, | ||
height = _element$getBoundingC.height; // Rect is more accurate than offset, use if near | ||
if (Math.abs(tgtWidth - width) < 1 && Math.abs(tgtHeight - height) < 1) { | ||
tgtWidth = width; | ||
tgtHeight = height; | ||
} | ||
setTargetSize({ | ||
width: element.offsetWidth, | ||
height: element.offsetHeight | ||
width: tgtWidth, | ||
height: tgtHeight | ||
}); | ||
@@ -31,0 +44,0 @@ } // Merge stretch style |
{ | ||
"name": "rc-trigger", | ||
"version": "5.3.3", | ||
"version": "5.3.4", | ||
"description": "base abstract trigger component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
142862
3079