oldValue and newValue are NaN
See original GitHub issueHi, I’m having this weird issue with fitty.
I have the following HTML structure:
And I’m using muicss together with this simple stylesheet:
And then at the end of the body, I import fitty via jsdelivr and initialise it with the right elements:
(The updateBadge
function uses the form fields to change the innerText
of the .example
elements, but otherwise doesn’t modify them)
The fit event triggers correctly on content change, but it doesn’t actually update the font size. It doesn’t even seem to get the current font size. Here is the log output of the fit event:
The first event is when fitty is initialised, the second when the event triggers from a content change. As you can see it cannot compute the new value, and even the current is a NaN
after the first event.
I tried everything I can think of, including removing all styles (with the exception of no-wrap
and inline-block
).
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Tried to find the issue but wasn’t successful.
I’d restart with a basic page and then work my way from there to find at what point the calculations go wrong.
Will try 👍