Merge pull request #6673 from akathuria289/scroll_activate
Fixed issue #6394
This commit is contained in:
commit
41fb2837a4
|
|
@ -289,9 +289,35 @@
|
|||
setTimeout(function() {
|
||||
document.getElementById('product-form').submit();
|
||||
}, 0);
|
||||
} else {
|
||||
this.activateAutoScroll();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
activateAutoScroll: function(event) {
|
||||
|
||||
/**
|
||||
* This is normal Element
|
||||
*/
|
||||
const normalElement = document.querySelector(
|
||||
'.control-error:first-of-type'
|
||||
);
|
||||
|
||||
/**
|
||||
* Scroll Config
|
||||
*/
|
||||
const scrollConfig = {
|
||||
behavior: 'smooth',
|
||||
block: 'end',
|
||||
inline: 'nearest',
|
||||
}
|
||||
|
||||
if (normalElement) {
|
||||
normalElement.scrollIntoView(scrollConfig);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue