nikitasnv / vue-resizable

VueResizable component
https://nikitasnv.github.io/vue-resizable/
MIT License
224 stars 46 forks source link

attributes are set when they shouldn't #9

Closed ricardovanlaarhoven closed 4 years ago

ricardovanlaarhoven commented 4 years ago

When i'm only activating 'r' I would expect that only the width of an html element would change. But the left, top and height are also set. I've even tried this:

<vue-resizable class="folders-wrapper d-flex" :width="300" :active="['r']" fit-parent :max-width="500" :min-width="100" :disable-attributes="['l', 't', 'h']">

But then the attributes are changed as wel.

The downside of this is that i can't set an element to have a height: auto

ricardovanlaarhoven commented 4 years ago

Workaround: add a height: auto!important

nikitasnv commented 4 years ago

Can you reproduce issue via codepen?

ricardovanlaarhoven commented 4 years ago

Take in mind that there are more reasons why the height could change but that this is an excellent example why.

https://codepen.io/ricardovanlaarhoven/pen/OJNEpYo

In my opinion when there are no directions of the height that are resizeable the height should not be set to that element. When only setting :active="['r']" height could not be touched, so it should not be set.

nikitasnv commented 4 years ago

Updated in 45fb317b1227fb9e540bb37d1eb98137d33599ab. Use disableAttributes property.