Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture fails 'body' capture in conjunction with bslib package #4

Open
Blocktt opened this issue Oct 7, 2021 · 2 comments
Open

Capture fails 'body' capture in conjunction with bslib package #4

Blocktt opened this issue Oct 7, 2021 · 2 comments

Comments

@Blocktt
Copy link

Blocktt commented Oct 7, 2021

I added the bslib package (custom CSS themes) to my R shiny app but have run into an issue with the 'Capture' download button. Without the bslib package, the Capture package works perfectly fine without any issues. Strangely, I don't have a problem until after I upload a csv file for manipulation (app takes a file and calculates stats on it). Said another way, Capture will screenshot the entire web page when there is no file is uploaded but will not work afterwards. Perhaps it's a CSS targeting issue? I'm running the app on Google Chrome. Here is the breakdown:

  1. Capture works fine to download an image of the full screen prior to the csv file being loaded.
    ,capture::capture(selector = "body" , filename = "all-page.png" , icon("camera-retro") , "Take screenshot of entire page" , class = "btn-primary")

  2. After the file is uploaded, the capture function stops working. Below is the inspection error I receive from Google Chrome.
    capture.js:65 Capture: oops, something went wrong! Event bubbles: false cancelBubble: false cancelable: false composed: false currentTarget: null defaultPrevented: false eventPhase: 0 isTrusted: true path: [img] returnValue: true srcElement: null target: null timeStamp: 33897.700000047684 type: "error" [[Prototype]]: Event

Am I missing something here? I can't see why capture would work before the csv file is loaded and not afterward. The app I'm running this on is quite complex, therefore, a reprex would not be useful.

@Blocktt Blocktt changed the title Capture fails 'body' capture in conjunction with bslib and leaflet packages Capture fails 'body' capture in conjunction with bslib package Oct 7, 2021
@pvictor
Copy link
Member

pvictor commented Oct 14, 2021

Not sure how I can help you without being able to reproduce the error.
Without bslib it works fine even after uploaded a file ?
You use Bootstrap 4 with bslib ?

Otherwise, maybe you will have better luck with shinyscreenshot ?

@Blocktt
Copy link
Author

Blocktt commented Oct 14, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants