Handle parent component width and height change
See original GitHub issue <div v-bind:style="windowStyle">
<vue-draggable-resizable
v-if="true"
:parent="true"
:w="1120"
:h="500"
>
<dashboard/>
</vue-draggable-resizable>
</div>
After changing windowStyle the drag is still blocked by the prev windowStyle size.
How can I sync the children with the new size? Thank you
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to get parent width/height in React using Hooks?
I think useCallback is what you want to use so you can get the width and height when it changes. const [height, setHeight]...
Read more >Sizing items in CSS - Learn web development | MDN
If you place an image on a page and do not change its height or width, either by using attributes on the <img>...
Read more >useElementSize() returns 0 width/height if initially rendered ...
For my use case, having a non-zero size reported once the parent is hidden isn't a problem, though reporting a size of 0x0...
Read more >Why can a child element have a bigger width or height than ...
Imagine the parent element as a window, not a container. The content that you see through the window might be much larger than...
Read more >Make text fit its parent size using JavaScript
We can "try" to increase the font size step-wise by 1 pixel and test again, whether the element is overflowing it's parent or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MaxYYYYY for me,it doesn’t work,because re-mount the components need some time,so I change the code like this:
@gsaada it works for me. actually it makes component mount again, the parent element avoid re-render so everything looks normal