Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResizeSensor kills performance when meets with a Window type #303

Open
kergekacsa opened this issue Aug 19, 2020 · 0 comments
Open

ResizeSensor kills performance when meets with a Window type #303

kergekacsa opened this issue Aug 19, 2020 · 0 comments

Comments

@kergekacsa
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant