Closed cjjkeesq closed 2 years ago
I had this same issue. I disabled the Gravity Forms "Automatic Scrolling On Form Confirmations" using this filter in functions.php:
add_filter( 'gform_confirmation_anchor', '__return_false' );
Docs: https://docs.gravityforms.com/disable-automatic-scroll-form-confirmation/
This allowed scroll.update(); to work correctly e.g.:
jQuery(document).on('gform_post_render', function(event, form_id, current_page){
scroll.update();
});
I'm using the plugin Gravity Forms for our website. The form I'm using has AJAX enabled and when I click the submit button, the page shifts because of the added validation errors.
Looking at https://docs.gravityforms.com/gform_post_render/ it should be possible to update the scroll container after the gform_post_render event. But It doesn't seem to work with the following code:
jQuery(document).bind('gform_post_render', function(){ console.log("Gravity updated"); scroll.update(); });
I do see the console log, but the scroll container still shifts in a weird way. What am I doing wrong?