1

On the log in page, when I don't input input in fields, the error message displays focusing on the invalid input. The window scrolls upto the invalid field at the same time.

I do not want the window to scroll. Where can I find the code for scrolling?

1

1 Answer 1

4

copy MAGENTO_ROOT/vendor/magento/magento2-base/lib/web/mage/validation.js into app/design/frontend/THEME_ROOT/web/mage/

then comment (start in line 1956)

if (firstActive.length) {
                $('html, body').animate({
                    scrollTop: firstActive.offset().top
                });
                firstActive.focus();
            }

become

if (firstActive.length) {
                /*$('html, body').animate({
                    scrollTop: firstActive.offset().top
                });*/
                firstActive.focus();
            }

or just delete

if (firstActive.length) {

                    firstActive.focus();
                }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.