JayeshLab / vue-resize-text

A vue directive which automatically resize font size based on element width.
https://jayeshlab.github.io/vue-resize-text/index.html
MIT License
71 stars 7 forks source link

Doesn't start at the correct size #14

Open Shardj opened 1 year ago

Shardj commented 1 year ago

This library only seems to kick in after I resize the viewport, I need the initial size to be reasonable too but it always starts at minFontSize.

bayareawebpro commented 1 year ago

I would like to use this package, but I really need this functionality as well.

Ideally, the "resize" callback needs to be fired once, when the element is first initialized, so that the starting size of the font is adjusted to fit the container.

** Looking at the code (https://github.com/JayeshLab/vue-resize-text/blob/master/src/VueResizeText.js#L46) it looks like this is being done, but for us it's not working. I'm not sure what the cause of this is.