MPR Vaadin 7 FileDownloader sizing issue

I have a weird problem with my MPR + Vaadin 7 app. When I click “download”, it resizes the screen incorrectly. First of all, here are images of the Vaadin 7 app:

![Vaadin 7 Before]
(https://i.postimg.cc/2SzY56Dm/Vaadin7-Supplier-Batch-Before-Download.png)

Figure 1: Vaadin 7 app before clicking “Download”

![Vaadin 7 After]
(https://i.postimg.cc/cLDp4BhM/Vaadin7-Supplier-Batch-After-Download.png)

Figure 2: Vaadin 7 app after clicking “Download”

Now, how things look with my MPR Vaadin 7 app ( virtually the same code, just some minor tweaks to get things working with MPR ):

![MPR Vaadin 7 Before]
(https://i.postimg.cc/g2B7Pkcg/MPRVaadin7-Supplier-Batch-Before-Download.png)

Figure 3: MPR Vaadin 7 app before clicking “Download”

![MPR Vaadin 7 After]
(https://i.postimg.cc/7YKsgYzq/MPRVaadin7-Supplier-Batch-After-Download.png)

Figure 4: MPR Vaadin 7 app after clicking “Download”

Hi,
what does Download do ?
Unfortunately the images have low quality and I can’t see anything.
But anyway it’s more important what the application does on Download action.

The key with the pictures is the scrollbars. Figure 2 ( pure Vaadin 7 ) has no scrollbars after download ( while it is hard to see the download file in the image, it is still visible at the bottom left corner ). With Figure 4 ( MPR + Vaadin 7 ), it adds scrollbars after the download is complete (the scrollbars on the side and bottom and the download file on the bottom left are visible enough to show the issue, I hope). Sorry for the unclear images. Didn’t think it would matter because the scrollbars are clear ( while a lot of the other stuff is all fuzzy ).

Anyway, as for what the application is doing, it is, in this case, downloading a CSV file from my server using the FileDownloader feature. These are all Vaadin 7 features, not converted yet to pure Flow.

  1. User clicks download button, which is a normal button extended with FileDownloader ( code below )
  2. FileDownloader code talks to backend, telling backend to create a CSV file, and backend gives CSV file back to frontend. This happens in a overriden getFileDownloadResource()
  3. Generated file downloads to machine.

The point is that the same code works fine in pure Vaadin 7 but does weird things with the sizing in MPR + Vaadin 7. I have a similar issue with the exporter add-on, https://vaadin.com/directory/component/exporter/discussions. I assume I am hitting some weird style issue. I am currently using MprTheme with my custom Valo theme, if that helps.

First of all, the customer CsvFileDownloader:

	private class CsvFileDownloader extends FileDownloader {

		/**
		 * 
		 */
		private static final long serialVersionUID = -1703929900936413587L;

		public CsvFileDownloader(Resource resource) {
			super(resource);
		}

		@Override
		public Resource getFileDownloadResource() {
			FileResource csvFileResource = null;
			try {
				LOGGER.info("Getting CSV file resource for " + type.toString());
				csvFileResource = generateCsvDataFile();
				csvFileResource.setCacheTime(0);
				if( csvFileResource instanceof FileResource ) {
					LOGGER.info("Got CSV file resource " + csvFileResource.getFilename() );
				} else {
					throw new WMSException( "Error getting CSV file resource for " +
							"downloading data for " + type.toString() );
				}
			} catch (WMSException e) {
				String message = e.getMessage();
				if( message == null || message.trim().isEmpty() ) {
					message = "Error getting data file for export.";
				}
				Notification.show("CSV Files", message, Type.ERROR_MESSAGE );
				LOGGER.severe(message);
			}

			return csvFileResource;
		}
	}

Secondly, how it is used and added to the form:

	protected FileDownloader buildCsvDownloader() {
		FileResource tempResource = new FileResource(new File(""));

		return new CsvFileDownloader(tempResource);
	}
	
	protected Button buildDownloadDataCsvBtn() {
		csvDataDownloader = buildCsvDownloader();
		//		csvDataDownloader = new FileDownloader(tempResource);
		//		csvDataDownloader.extend(csvDataDownloaderBtn);

		final Button downloadDataBtn = buildDownloadCsvBtn();
		csvDataDownloader.extend(downloadDataBtn);

		return downloadDataBtn;
	}

So, do I understand correctly that you don’t add anything on the page as a result of the code execution ?
It’s just your FileDownloader extension implementation .
And nothing else is involved in the action ?

So this code with the custom FileDownloader works fine in V7 but has scrolling issue in MPR, right ?
It looks like a bug.
Could you please create a ticket ?

I don’t think anything else is involved. I suppose I might display error messages and what not, but I don’t in this case as far as I know because no errors.

Yes, code works with pure V7. I made one minor change for my MPR + Vaadin 7 code - since FileDownloader, by it’s very nature, starts a new thread and my code requires the UI and Session, I had to pass the local copies of this down to the FileDownloder stuff ( Vaadin 7 does not have this requirement, but Flow of course does, as per the documentation ). I cannot create a ticket ( not that type of account ), but I can submit a bug report to github if you want me to.

Because of my issues with https://vaadin.com/directory/component/exporter/discussions, I feel like it is some style issue. But that is just a guess. Don’t know what to look for to confirm.

Yes, please submit a [Github issue]
(https://github.com/vaadin/multiplatform-runtime/issues).

Thanks, and added at https://github.com/vaadin/multiplatform-runtime/issues/57. Hopefully I gave proper information.