vue-resizable icon indicating copy to clipboard operation
vue-resizable copied to clipboard

Resize to parentElement option on handleUp

Open kas84 opened this issue 5 years ago • 4 comments

Hi! Would you be open to adding an option to resizing the element to the size of its parent when handlingUp? Something like:

if (this.resizeToParentSize) this.w = this.$el.parentElement.clientWidth;

In my case I need to calculate the size on the elements parent as a percentage (like the full width is 24h and I want it to be resizable for each hour or half an hour).

On the parent I have a div like this:

<div :style="getStyle(data)"></div>

And this getStyle is calculating the width as a percentage basing on the data.

kas84 avatar Sep 16 '20 20:09 kas84

Do you still have a problem?

nikitasnv avatar Mar 06 '21 14:03 nikitasnv

Yes, even though I'm not really using it, because I encountered other problems with a virtual scroll library

kas84 avatar Mar 09 '21 18:03 kas84

I will not add additional parameters for the component if it is not needed. Have you tried setting the correct dimensions when calculating the data (width, height props)?

nikitasnv avatar May 07 '21 18:05 nikitasnv

I will revisit this problem this week. I will let you know... The main problem for me was that it was not working correctly with a virtual scroll library, but maybe it was because of my resize to parentElement option.

kas84 avatar May 10 '21 11:05 kas84