Panel scrolling issue when added to undefined sized tabsheet

For my application I need a tabsheet and panels as tabs. So the hierarchy is TabSheet → Panel → Other components. When tabs are changed I wish to center/move the scrollbars of currently selected tab. This works only if the tabsheet’s size is defined as full or in pixels but not when it is left undefined.

	Window mainWindow = new Window("Poc_tabsheet_panel Application");

		final Panel panel = new Panel();

		for (int i = 0; i <= 50 ; i++) {
			panel.addComponent(new Label("Label "+ i));

		final TabSheet tabsheet = new TabSheet();
		tabsheet.addListener(new SelectedTabChangeListener() {

			public void selectedTabChange(SelectedTabChangeEvent event) {

		tabsheet.addTab(panel, "Panel", null);
		tabsheet.addTab(new Button("Test button"), "Test", null);


If tabsheet’s size is defined, the scrolling part (line #19) works perfectly, the only problem is that for my application I need to use tabsheet.setSizeUndefined so that tabsheet expands according to its content.

Am I missing something?

Bump. Is there any possible solution/workaround?