css-element-queries icon indicating copy to clipboard operation
css-element-queries copied to clipboard

ResizeSensor kills performance when meets with a Window type

Open kergekacsa opened this issue 5 years ago • 0 comments
trafficstars

Hi there!

I've found an infinit loop in this line: (at https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js#L239 ) var invisible = element.offsetWidth === 0 && element.offsetHeight === 0;

The problem is that Windows types doesn't have offsetWidth/offsetHeight, so it's basically redraw the whole layout again and again. It would be a nice touch if in case os a Window type if could use a little smarter check for invisibility. I've think something like this: https://gist.github.com/danbrianwhite/bcdd7fbd6d775a4e0dc0

What do you think?

kergekacsa avatar Aug 19 '20 20:08 kergekacsa