Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Possible to scroll into view without jquery, especially in Now Mobile?

thomaskennedy
Tera Guru

I need to scroll my multirow variable into view after it fails input validation, that is, in an onSubmit script. I'm not able to scroll to the mrvs control, but I can scroll to its Remove All button:

 

var btnRemoveAll = $j("button:contains('Remove All')")[0];
btnRemoveAll.scrollIntoView({ behavior: "smooth", block: "start" });

 

That works fine on the desktop. But in Now Mobile nothing happens. What can I do?

 

 

1 REPLY 1

thomaskennedy
Tera Guru

I also tried it without the $j but the result is the same.

 

var btnRemoveAll = document.querySelector("[aria-label='Remove all rows for Affected SKUs']");
btnRemoveAll.scrollIntoView();