I have been stuck on this problem for quite some time, basically when using insertUI to create a new inputText, it also creates a new label. The label itself doesn't have an ID associated with it, so when we call removeUI, only the input text box gets deleted but not the label, leaving annoying snippets of text all over your program!!!
Here is the code I used:
insertUI(
selector = "#evControls",
where = "afterEnd",
ui = textInput(inputId = el_id, label = el_text, width = "100%", placeholder = "Example: -EV0 -EV24 -kgmp"),
immediate = FALSE
)
...
removeUI(
selector = paste0("#", el_id),
multiple = TRUE,
immediate = TRUE,
session
)
In browser this is the code created:
<div class="form-group shiny-input-container" style="width: 100%;">
<label for="LabFe">Fe</label>
<input id="LabFe" type="text" class="form-control shiny-bound-input" value="" placeholder="Example: -EV0 -EV24 -kgmp">
</div>
And after it gets removed:
<div class="form-group shiny-input-container" style="width: 100%;">
<label for="LabFe">Fe</label>
</div>
Has anybody else experienced this? Is there a work around?