Skip to content

Commit 5259190

Browse files
committed
fix: sensor not working when element's width or height is 0
1 parent d73bb3d commit 5259190

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ResizeSensor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
element.resizeSensor = document.createElement('div');
111111
element.resizeSensor.className = 'resize-sensor';
112-
var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
112+
var style = 'position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
113113
var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;';
114114

115115
element.resizeSensor.style.cssText = style;

0 commit comments

Comments
 (0)