Inclusion of html in shiny led to certain packages not working

I've written an app that I wish to include an HTML file as information.

I used includeHTML("Explanation_risk_calc.html") in the UI, I noticed some odd app behaviour. For example, the collapsibility of shinydashboard boxes seems to have disappeared as the boxes stay expanded. Some packages like shinyvalidate no longer work (not validating inputs in this case).

For the time being, I have made the file as a separate download but can anyone explain this? Is there a workaround?

What is the content of your html file?


It's a mix of text and some code that's not dependent on input in the app.

don't know if this would work or not but worth a try; give a button and then have shiny try to open the html in a separate browser window :

observeEvent(input$some_button, {
                  browser = getOption("browser"),
                  encodeIfNeeded = FALSE

if this doesnt work then, assuming the code within the html is javascript then the implication is that this doesnt play nice with shiny; therefore
a) if you dont need the code in the html ; remove it ?
b) if you do need the code; take advice from a javascript expert on how to make the javascript play nice ?

1 Like

Thanks. I will give that a try. I had thought it was something not playing nicely with shiny. Thanks for taking the time to reply.

I'd put the file in the www folder and embed it using an iframe.

Please check my related answer here:

1 Like

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.