CalderaWP / Caldera-Forms

Drag and drop, responsive WordPress form builder.
https://CalderaForms.com
GNU General Public License v2.0
187 stars 163 forks source link

Declare Passive Event Listeners #3300

Open New0 opened 5 years ago

New0 commented 5 years ago

Mentioned at https://secure.helpscout.net/conversation/914958775/22368?folderId=832038

Results of audit shows the CF frontend script could be improved using document.addEventListener('touchstart', onTouchStart, {passive: true});

Browsers usage https://caniuse.com/#feat=passive-event-listener

indepthwebdesign commented 5 years ago

Seems to be a straight forward fix. Would you be able to supply the plugin in the non-minified version for testing?

New0 commented 5 years ago

Hello @guardiandesigns , you can use the 'caldera_forms_render_assets_minify' filter hook to load unminified assets. Like add_filter( 'caldera_forms_render_assets_minify', '__return_false' ); in a custom plugin or functions.php file of your (child-)theme.

If you want to contribute, make sure you create a branch from develop and open a Pull Request against develop ( https://github.com/CalderaWP/Caldera-Forms/blob/master/CONTRIBUTING.md )