syropian / vue-input-autowidth

A Vue.js directive that automatically resizes an input's width to fit its contents.
MIT License
102 stars 18 forks source link

Padding breaks autowidth in Vue 3 #59

Open OwenVey opened 2 years ago

OwenVey commented 2 years ago

Using the v2 branch, whenever I add left/right padding, the width is not accounting for it and therefore cuts off text. image

syropian commented 2 years ago

Hey there, thanks for the report.

Do you have box-sizing: border-box applied to your input (implicitly or explicitly)? As long as you do, the width should display correctly, as the plugin does take padding into account (see https://github.com/syropian/vue-input-autowidth/blob/v2/lib/directive.ts#L92-L93)