Giter Club home page Giter Club logo

Comments (5)

saltycrane avatar saltycrane commented on June 7, 2024

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.

seleckis avatar seleckis commented on June 7, 2024

Yes it works, but sometimes it flashes with larger font sizes while window resizing. Chrome/Mac

from use-fit-text.

saltycrane avatar saltycrane commented on June 7, 2024

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.

seleckis avatar seleckis commented on June 7, 2024

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.

saltycrane avatar saltycrane commented on June 7, 2024

@seleckis I published [email protected]. See if that works for you.

from use-fit-text.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.