title: Vaadin FileDownload requires the button be clicked twice to download
body: <p>I'm following the Vaadin sample code but when I do I require a second click to start the file download. Below is my code:</p>
  
  <pre><code>final StreamResource streamResource = new StreamResource(
          () -&gt; {
              return new ByteArrayInputStream("hello world".getBytes());
          }, document.getName() + ".txt");
  
  FileDownloader fileDownloader = new FileDownloader(streamResource);
  fileDownloader.extend(getDownloadButton());
  </code></pre>
  
  <p>There's nothing special about the code to create the button but as requested in the comments here it is:</p>
  
  <pre><code>Button downloadButton = new Button("Download");
  </code></pre>