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

if the parent node is not displayed when it is initialized, the event of the child node cannot be triggered when the parent change is displayed. #228

Closed zsedcbm closed 5 years ago

zsedcbm commented 6 years ago

I used Vue.resize, it used ResizeSensor.js

child component used v-resize

when parent used v-show, the dom with v-show is "display:none", then child resize event is not work

when parent used v-if, then child resize event is work,

4

https://codepen.io/zsedcbm/pen/erQomg

zsedcbm commented 6 years ago

I simplified the example.

If the child node is displayed at the time of initialization, then the grandchild node can trigger the event normally.

normal

However, if the child node is not displayed when it is initialized, the event of the grandchild node cannot be triggered when the later change is displayed.

error

https://codepen.io/zsedcbm/pen/VxgMJL

marcj commented 5 years ago

This should be fixed in current version. Can you retry?

zsedcbm commented 5 years ago

good job, it worked

blemaire commented 5 years ago

This should ideally be fixed in this repository, otherwise every application that uses a similar system as v-show in Vue.resize has to implement a similar method. Per instance we use angularJs and we have the same issue when we use ng-if. Thanks

marcj commented 5 years ago

@blemaire have you tried the current version? If it doesn't work, please prepare me some reproduction code, on jsfiddle or somewhere.