ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
146 stars 23 forks source link

Custom classes lost with bs_attach_collapse #55

Closed riccardoporreca closed 4 years ago

riccardoporreca commented 6 years ago

When bs_attach_collapse() is called on a button with custom additional classes, e.g.:

bs_button("She Loves You", class = "collbtn collapsed")
## <button class="btn btn-default collbtn collapsed">She Loves You</button>

such classes are lost:

bs_button("She Loves You", class = "collbtn collapsed") %>%
  bs_attach_collapse("yeah")
## <button class="btn btn-default" data-toggle="collapse" data-target="#yeah">She Loves You</button>

This can be a limitation when one wants to use styles to customize how the button looks like when the corresponding panel is collapsed / expanded, which is also the reason behind the example above.

See the attached example Shiny app bs_attach_collapse_custom-class.R, where the classes were added back using tagAppendAttributes() as a workaround.

riccardoporreca commented 4 years ago

Confirm this is fixed with #63