Closed Cordemans closed 7 years ago
Same problem here!
I only see a single flash when the example starts. Even when I add a counter to the text value that increases with each interval, all intervals are smooth except the first. I'm not sure if that's morphdom or jsfiddle resetting the results canvas.
I put some checks to only set the nodeValue
on the text nodes if the old value doesn't match the new value. Please let me know if that helped, but like @AutoSponge, I am not convinced there was a problem with morphdom.
Which browser were you seeing the flashing in? Do you still see the flashing with morphdom@2.3.3
?
Thanks! I can confirm that the flashing does not occur in morphdom@2.3.3
See image for an example what I see in Firefox 54 with morphdom@2.3.2
:
I noticed a lot of flashes in the element inspector for elements that did not actually changed. When I removed the text inside those elements, they did not flash anymore.
In this example you will notice - at least with Firefox and the element inspector open - that the element with text keeps flashing and the other element without any text does not flash: https://jsfiddle.net/ufc3wazq/2/
Should the nodeValue for a TEXT_NODE only be updated when its value actually changed?