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");
		setMainWindow(mainWindow);

		final Panel panel = new Panel();
		panel.setWidth("400px");
		panel.setHeight("400px");
		panel.setScrollable(true);

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

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

			@Override
			public void selectedTabChange(SelectedTabChangeEvent event) {
				panel.setScrollTop(100);
			}
		});

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

		mainWindow.addComponent(tabsheet);

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?