문제

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?

도움이 되었습니까?

해결책

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();
                }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top