Comments (5)
Hi @seleckis, I published v1.2.1 to npm that allows setting an option to recalculate on window resize. Example usage:
const { fontSize, ref } = useFitText({ recalcOnResize: true });
Commit: 0bd49d6
Example: https://github.com/saltycrane/use-fit-text/blob/v1.2.1/examples/pages/index.js#L32-L49
Hope that works for you!
from use-fit-text.
Yes it works, but sometimes it flashes with larger font sizes while window resizing. Chrome/Mac
from use-fit-text.
Could you try copy/pasting the useFitText
code into your project and adjusting the setTimeout
delay here: https://github.com/saltycrane/use-fit-text/blob/master/index.ts#L50 ? Or could you create an example repo the reproduces the problem that I can play with?
from use-fit-text.
I have tried to change setTimeout delay, but still the same issue, it sometimes flashes even with 0 timeout. Check this screen recording: https://we.tl/t-oal2LRcGnY
from use-fit-text.
@seleckis I published [email protected]
. See if that works for you.
from use-fit-text.
Related Issues (16)
- Not resizing on dynamically received data HOT 8
- Support non-px width values? HOT 1
- Cannot find type definition file for 'next'. HOT 3
- How to be sure that redraw is finished ? HOT 4
- Maximum update depth exceeded HOT 13
- Text exceeds the div boundary for some font family HOT 9
- Initial fontSize value is not updated and onStart/onFinish do not fire HOT 5
- Overflow with padding HOT 2
- Not resizing on dynamically received data
- Hide text before resize finishes HOT 3
- We can get rid of the binary search in the font size algorithm HOT 2
- Fails setting `lineHeight` HOT 3
- Not resizing on the first rendering HOT 1
- Consider removing polyfill
- Fill the whole width initially & 'text-align: center;' problem
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 use-fit-text.