Is it possible to answer this question without needing a repro demo? My goal is to delete all div
elements under the parent div with id="daterangescontrol"
every time I upload a file to my Shiny app. The code I have written looks like this:
removeUI(selector = "div#daterangescontrol div")
Just to clarify, under div#daterangescontrol
, there are dynamically generated div#daterange1
, div#daterange2
, and so on up to div#daterange(n)
based on the columns in the dataset that can be converted to Date. My ultimate aim is to remove all these child divs when a new file is uploaded (new dataset). However, the current line of code only deletes the first child, for example, div#daterange1
. Could it be because I am using the wrong syntax for the selector? I'm not very familiar with css. Can someone please assist me? Thank you!
UPDATE:
For a demonstration of the code, refer to my other post:
How to validate date range input in Shiny
and look at the usage of removeUI
within observeEvent(input$file)
.