-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oldValue and newValue are NaN #81
Comments
can you create a public test case for this? |
Here is the index file (minus the backend template parts). The actual web app has already been updated with a different method so no online test alas :/ GitHub doesn't allow HTML extensions, so I had to change it to txt index.txt. |
It would be easiest if you can create a reproduction on codesandbox.io |
Here it is https://codesandbox.io/s/fitty-test-29ksf Didn't know about that website, thanks for the suggestion! |
It throws an "Cannot import an empty path" error, not sure what I should be looking at? |
Fixed it. It's a codesandbox error, apparently it doesn't like empty src attributes. To see the error just enter values in the username and label fields. The example tags update the content correctly, but the fit events cannot determine their font size. |
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 👍 |
Hi,
I'm having this weird issue with fitty.
I have the following HTML structure:
![Screenshot 2022-01-19 at 11 27 53](https://user-images.githubusercontent.com/5142004/150112550-95a13b67-84b2-4b1f-8325-5785154d2a28.png)
And I'm using muicss together with this simple stylesheet:
![Screenshot 2022-01-19 at 11 19 35](https://user-images.githubusercontent.com/5142004/150111210-23d299a2-739d-4997-ac16-aef416c35cae.png)
And then at the end of the body, I import fitty via jsdelivr and initialise it with the right elements:
![Screenshot 2022-01-19 at 11 15 08](https://user-images.githubusercontent.com/5142004/150110530-e5c3b56b-3afd-455f-aa90-6e55d9bb68d4.png)
(The
updateBadge
function uses the form fields to change theinnerText
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:
![Screenshot 2022-01-19 at 11 17 48](https://user-images.githubusercontent.com/5142004/150111874-231d4572-8c4f-480c-921f-294e399b1b52.png)
![Screenshot 2022-01-19 at 11 17 55](https://user-images.githubusercontent.com/5142004/150111901-6e9097cb-ba82-4d49-a394-43e7044f7f1b.png)
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
andinline-block
).The text was updated successfully, but these errors were encountered: