rusackas commented on pull request #11778:
URL: 
https://github.com/apache/incubator-superset/pull/11778#issuecomment-733151384


   > > Can we add a loading state to the menu component (which determines 
whether to close the menu), and a callback for the `downloadImage` function?
   > 
   > I tried doing something like `this.setState({ menuVisible: false }, () => 
downloadImage())`, but the menu was still visible on the screenshot.
   
   I think this might be _almost_ to a solution. I haven't tried this, but 
something like the following _might_ work:
   
   1) setState with `menuVisible: false` and `takingScreenshot: true`
   2) set the dropdown to use the `onVisibleChange` prop (which I _hope_ is 
called after the menu disappears) to trigger a `takeScreenshot` method
   3) `takeScreenshot` would then:
   * Check if `takeScreenshot` is true
   * Take/download the screenshot if so
   * Set `takeScreenshot` to false
   
   This all depends on the timing of that `onVisibleChange` callback, but I'm 
hopeful :D


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to