Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
7.6.3: Clicks on TabSheet tabs causes scrolling?
I noticed some funky behavior in a project and created a simple test project that replicates it. If I have a TabSheet embedded in a layout that has height greater than the screen height (meaning it scrolls), clicking on a Tab results in scrolling.
In the attached screenshots, cap01 shows the top of the layout, cap02 shows the TabSheet, scrolled all the way to the bottom, and cap03 shows the result after clicking to a different tab. I don't remember this being an issue before. Am I missing something?
// source for the post above
package com.vaadin.test;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
@Theme("vaadin_test")
public class VaadinTestApp extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = VaadinTestApp.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
setContent(buildContent());
}
private Component buildContent() {
VerticalLayout rootLayout = new VerticalLayout();
rootLayout.setMargin(true);
rootLayout.setSpacing(true);
// create a bunch of fillers to occupy vertical space
for (int i=0; i < 10; i++) {
rootLayout.addComponent(buildFiller("Filler " + i));
}
// create TabSheet at the bottom of the layout
TabSheet tabSheet = new TabSheet();
for (int i=0; i < 5; i++) {
tabSheet.addTab(buildFiller("Tabsheet Filler " + i), "Test " + i);
}
rootLayout.addComponent(tabSheet);
return rootLayout;
}
private Component buildFiller(String caption) {
VerticalLayout layout = new VerticalLayout();
layout.setCaption(caption);
for (int i=0; i < 5; i++) {
layout.addComponent(new Label("Label " + i));
}
return new Panel(caption, layout);
}
}
I am facing this same issue. Please let me know how to fix this issue as this is very irritating to get the window scroll the very top when I am clicking the tab sheet placed in the very bottom.
Thanks.