question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

oldValue and newValue are NaN

See original GitHub issue

Hi, I’m having this weird issue with fitty.

I have the following HTML structure: Screenshot 2022-01-19 at 11 27 53

And I’m using muicss together with this simple stylesheet: Screenshot 2022-01-19 at 11 19 35

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

(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: Screenshot 2022-01-19 at 11 17 48 Screenshot 2022-01-19 at 11 17 55

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:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rikschenninkcommented, Jan 24, 2022

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.

0reactions
MatteoCampinoti94commented, Jan 24, 2022

Will try 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python/Pandas - Combine two columns with NaN values
Your solution should be change with Series.add and fill_value=0 : df["AllValues"] = df["Newvalues"].add(df["OldValues"], fill_value=0).
Read more >
Check if oldValue was empty/null in onChange client script?
I have a client script that clears values of multiple fields, but I only want it to clear those fields IF the oldValue...
Read more >
Field History Tracking - OldValue and NewValue null?
When I updated the field on the custom object, I checked to see if the corresponding __History object had been created in Eclipse....
Read more >
page set to NaN in $pagination.limit $watch() #255 - GitHub
If $pagination.limit changes from undefined to a number, calculating the following formula Math.floor(((self.page * oldValue - oldValue) + ...
Read more >
Break on NaN in gdb - Roman Cheplyaka
Hardware watchpoint 2: *x Old value = -0.19219211672498604 New value = -nan(0x8000000000000) f2 (z=0x4052a0) at nan.c:11 11 *z += 1.0;.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found