scroll to view

Is there any possibility to let the app scroll to a view?

I use a polymer template and I want to add js in a vaadin class like


UI.getCurrent().getPage().executeJavaScript(
								"alert('test');" + 
								"$(\'#test\').log();"
								);

but then I return in an error:

TypeError: $(...).log is not a function

Since the test ist null. How can I scroll programatically to an element using js in vaadin or is there a own vaadin method i can use in flow 12?

Hello Ines,

if you want to scroll to the bottom of the component’s scroll view, you can execute the following JS code from flow:

UI.getCurrent().getPage().executeJavaScript("$0.scrollTo(0,$0.scrollHeight);", component);

Note, that $0 is the first argument, in this case it represents a component. If you have more parameters, they would be $0,$1,$2,…