From 28bccea57be3039e0613a1b27545fb44a302796e Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 14 Aug 2021 13:43:38 +1000 Subject: [PATCH] Cleanup --- InvenTree/templates/js/translated/forms.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index d03819a00f..904053a423 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -899,8 +899,6 @@ function handleFormErrors(errors, fields, options) { } } - var offset = 0; - if (first_error_field) { // Ensure that the field in question is visible document.querySelector(`#div_id_${field_name}`).scrollIntoView({ @@ -908,7 +906,7 @@ function handleFormErrors(errors, fields, options) { }); } else { // Scroll to the top of the form - $(options.modal).find('.modal-form-content-wrapper').scrollTop(offset); + $(options.modal).find('.modal-form-content-wrapper').scrollTop(0); } $(options.modal).find('.modal-content').addClass('modal-error');