Home › Forums › Backend Issues (wp-admin) › JS performance issues › Reply To: JS performance issues
I have run in to this issue as well. It seems like a very serious one, too.
In advanced-custom-fields/js/input.js, in the acf.conditional_logic object, the change event gets called for every single ACF input on the page.
This causes the JS to get slower and slower with each new field (or set) added because it’s checking the conditions for every field instead of just what was added or modified.
In addition to this, there is some display modifications on the elements during these nested loops that is causing a browser recalculate/reflow for every input. This all adds up to an increasingly slow, and at a certain point, unusable experience.
I put some timers in the code to illustrate the time increases with each new set of fields added.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.