ebailey78 / shinyBS

Twitter Bootstrap Components for Shiny
182 stars 47 forks source link

bsCollapsePanel's title argument shows a warning when handling a list #50

Open nuno-agostinho opened 9 years ago

nuno-agostinho commented 9 years ago

I'm trying to add an image to the title of a bsCollapsePanel with the following code:

bsCollapsePanel(
    style = "info",
    title = list(img(src = "add-button-16px.png"),
                 "Add file"),
    fileInput("data.file", "Choose a file")
)

The code works fine, but it shows two warnings probably related to the title argument:

Warning in if (getAttribs(panels[[i]])$value %in% open) { :
  the condition has length > 1 and only the first element will be used
Warning in if (!is.na(attribValue)) { :
  the condition has length > 1 and only the first element will be used

This is the result (which seems to be working with no problems): screen shot 2015-09-28 at 13 51 57

Possible solution: The title argument could be replaced by an id argument (the identifier of the panel) and a display argument (which would be what's really shown).

shosaco commented 7 years ago

you can use value="yourValue" to solve this problem.