Comments (12)
We had the exact same issue and fixed it.
- box-sizing needs to be initial (default)
- You need the comfort zone to be around 25 (for smoothness)
- You need that comfort zone to apply before and after the text. (left and right)
=> Set the text align to center to achieve this.
from vue-input-autowidth.
Thanks for investigating guys, I'm going to play around with it today and see if I can come up with anything.
from vue-input-autowidth.
Thanks for the report! Do you have box-sizing: border-box;
on that element's css? I'm unable to reproduce in the repo example. Could you copy your example to a JSFiddle or similar?
from vue-input-autowidth.
It's really bizarre. My example is a little too complex to post on jsbin.
However, when building a simple input component in jsbin it works fine (unless I add CSS letter-spacing
).
But when I remove all of the styles of my app's component it still flickers.
Even when I remove
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
from the global CSS.
from vue-input-autowidth.
Addition: On an old project, with no previous problems whatsoever, I just updated vue
, vue-loader
and vue-template-compiler
to their latest versions. Now I have the same problem flicker showing up.
from vue-input-autowidth.
Very strange! Almost makes me think it's something funny with Vue's re-rendering code. I'll spend a bit of time seeing if I can reproduce.
from vue-input-autowidth.
Various things seem to exacerbate the problem. With my CodePen I have so far identified letter-spacing
, font-size
and box-sizing
as potential factors.
I was using 2.5.2
of Vue. And again: only problems in Chrome/Safari showing up. Not in Firefox.
from vue-input-autowidth.
It's a bit surprising letter-spacing affects it, as I do copy letter-spacing to the clone helper. I have not checked compatibility with the latest version of Vue, so I'll have to do that.
from vue-input-autowidth.
I played with the pen I posted above, and changing box-sizing
and text-align: center
had no impact whatsoever.
Only increasing the comfortZone
to 25
seemed to smoothen things.
from vue-input-autowidth.
Similar issue here. Tried the workarounds but still having some small flickering.
from vue-input-autowidth.
Same problem, adding comfort zone 20+ fixes it but this is a little too high for me unfortunately
from vue-input-autowidth.
I tried in the latest version of Chrome and I wasn't seeing this anymore with the latest version of the package.
from vue-input-autowidth.
Related Issues (20)
- Doesn't work? HOT 2
- The mirror span is still read by screen readers HOT 2
- Maybe too narrow on Firefox HOT 2
- Wrong width HOT 7
- Release problem HOT 1
- Autowidth on select element HOT 2
- box-sizing: content-box (bootstrap 4)
- Paste text breaks max width HOT 4
- Not working when using :value directive on input. HOT 3
- Kindly add Support for Typescript HOT 2
- Autowidth issue after using IME HOT 6
- Vue 3 support HOT 5
- Auto width calculated incorrectly on page load
- wrong width on password input
- Vue 3 doesn't work. Please fix. HOT 1
- Padding breaks autowidth in Vue 3 HOT 1
- [Vue warn]: A plugin must either be a function or an object with an "install" function. HOT 4
- Wrong width on Input with type number HOT 4
- Not working when trying to use it with Nuxt3. HOT 2
- Destroy mirror span on directive unbind HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-input-autowidth.