marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

add reset() to ElementQueries #254

Closed DmitryEfimenko closed 5 years ago

DmitryEfimenko commented 5 years ago

fixes #185

DmitryEfimenko commented 5 years ago

can we please merge this? A feature I'm working on is blocked by this.

marcj commented 5 years ago

Moving a DOM element is already covered automatically, see https://github.com/marcj/css-element-queries/commit/f6144fb52192efc6371aaebf0c72f7408fea17d3. Have you tried the newest version already?

DmitryEfimenko commented 5 years ago

ah, you're right. It works. Just not quite in all scenarios.

  1. The element that's being dragged is a parent of the element, which has the ResizeSensor. In this case the MutationObserver does not report on the child element of the element that's being dragged.
  2. The element that has the ResizeSensor does not have a display style set to something that makes it to actually have positive width and height. This happens for custom elements, such as Angular components (host elements).

The fix in this PR actually solves these issues, but not automatically, which is a shame. Though I no longer think that's the proper solution to these issues. Perhaps I should open separate issues for this.