Skip to content

Commit fdb851e

Browse files
lxjwltmarcj
authored andcommitted
fix: sensor not working when element's width or height is 0 (#203)
1 parent bc8541c commit fdb851e

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
@@ -110,7 +110,7 @@
110110
element.resizeSensor = document.createElement('div');
111111
element.resizeSensor.dir = 'ltr';
112112
element.resizeSensor.className = 'resize-sensor';
113-
var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
113+
var style = 'position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
114114
var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;';
115115

116116
element.resizeSensor.style.cssText = style;

0 commit comments

Comments
 (0)