Skip to content
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

Fix multiple charts facade and small google fix #1065

Merged
merged 6 commits into from
Dec 18, 2023

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Dec 12, 2023

Summary

The problem: after the first chart started the rendering process, the function displayChartsOnFrontEnd() triggered again.

Because the charts were empty (they were in the process of rendering), this code removed the rendering status $( 'div.viz-facade-loaded:not(.visualizer-lazy):not(.visualizer-cw-error):empty' ).removeClass( 'viz-facade-loaded' );

And then this `$('div.visualizer-front:not(.visualizer-lazy):not(.viz-facade-loaded)') put it again in the loop since it considered that they never started the rendering process.

Practically, we were re-rendering the charts that were not finished.

Thus, the infinite loop was crashing the page.

I simplified the logic. Now, after the page loads, the rendering of the chart is triggered once.

Testing

  • Check the rendering of the chars; they should not affected.
  • Now, Elementor and Gutenberg should not freeze when multiple charts are present.

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Dec 12, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue Dec 12, 2023 that may be closed by this pull request
@pirate-bot
Copy link
Contributor

pirate-bot commented Dec 12, 2023

Plugin build for 8a0dfcb is ready 🛎️!

Copy link
Contributor

@preda-bogdan preda-bogdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, left some code format NITs. Maybe if you have time we can also consider a test.

js/render-google.js Outdated Show resolved Hide resolved
js/render-facade.js Outdated Show resolved Hide resolved
@irinelenache
Copy link

irinelenache commented Dec 15, 2023

@Soare-Robert-Daniel Tested and the editor issue is fixed now, thank you ✔️

Found something strange:

  • The visualizer charts are not always rendered in front-end, depending on how fast i move the cursor through the page after the refresh. I even disabled the lazy-load for every chart but the issue still persists. Here is a video with the behaviour https://vertis.d.pr/v/MmPna1

Can be checked here:

Admin area URL: https://elem-vis.s1-tastewp.com/wp-admin 
Username: irinel 
Password: wskRTgmW6Jg 

@Soare-Robert-Daniel
Copy link
Contributor Author

@irinelenache, it seems that depending on browser loading, the events might be overloaded and ignored.

I added a short delay as a fix.

@irinelenache
Copy link

@Soare-Robert-Daniel Checked again and everything's fine now, thank you 🚀

@vytisbulkevicius vytisbulkevicius merged commit 7cd7b83 into development Dec 18, 2023
8 checks passed
@vytisbulkevicius vytisbulkevicius deleted the fix/charts-refresh branch December 18, 2023 18:56
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 3.10.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Charts break the Elementor editor
6 participants