Closed pvictor closed 5 years ago
Hello,
Little change to keep previous attributes in a tag in bs_set_attr(), especially when the attribute is multiple :
bs_set_attr()
tag <- tags$div(class = "class1", class = "class2") tag # <div class="class1 class2"></div> tag$attribs # $class # [1] "class1" # # $class # [1] "class2"
Old & new behavior :
tag <- htmltools::tags$div(class = "class1", class = "class2") ## old : class2 is dropped bsplus:::bs_set_attr(tag, target = "#target") # <div class="class1" data-target="#target"></div> ## new : class 2 is preserved bsplus:::bs_set_attr(tag, target = "#target") # <div class="class1 class2" data-target="#target"></div>
It fixes one issue in shinyWidget : https://github.com/dreamRs/shinyWidgets/issues/215 And will solve this one in bsplus : https://github.com/ijlyttle/bsplus/issues/55
Victor
This looks great, thanks!
Hello,
Little change to keep previous attributes in a tag in
bs_set_attr()
, especially when the attribute is multiple :Old & new behavior :
It fixes one issue in shinyWidget : https://github.com/dreamRs/shinyWidgets/issues/215 And will solve this one in bsplus : https://github.com/ijlyttle/bsplus/issues/55
Victor