You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting at line 12 in the function definition of messageItem, the following logic shiny::tagList(shiny::a(class = itemCl, id = inputId, href = if (is.null(inputId)) { "#" } else { href }, ...)
returns "#" even if href is supplied as input.
If the behavior is correct, I suggest updating the function description to be more precise in what is required. Else, I believe what may have happened was a "!" was missed in the logic so that: href = if (!is.null(inputId)) { "#" } else { href }
is the intended behavior. This would allow not having to create unused inputId variables.
Thanks!
messageItem <- function (from, message, icon = shiny::icon("user"), time = NULL,
href = NULL, image = NULL, color = "secondary", inputId = NULL)
{
tagAssert(icon, type = "i")
if (is.null(href))
href <- "#"
if (!is.null(color))
validateStatusPlus(color)
itemCl <- "dropdown-item"
if (!is.null(inputId))
itemCl <- paste0(itemCl, " action-button")
shiny::tagList(shiny::a(class = itemCl, id = inputId, href = if (is.null(inputId)) {
"#"
}
else {
href
}, target = if (is.null(inputId)) {
if (!is.null(href))
"_blank"
}, shiny::div(class = "media", if (!is.null(image)) {
shiny::img(src = image, alt = "User Avatar", class = "img-size-50 mr-3 img-circle")
}, shiny::tags$div(class = "media-body", shiny::tags$h3(class = "dropdown-item-title",
from, if (!is.null(icon)) {
shiny::tags$span(class = paste0("float-right text-sm text-",
color), icon)
}), shiny::tags$p(class = "text-sm", message), if (!is.null(time)) {
shiny::tags$p(class = "text-sm text-muted", shiny::tags$i(class = "far fa-clock mr-1"),
time)
}))), shiny::tags$div(class = "dropdown-divider"))
}
The text was updated successfully, but these errors were encountered:
Starting at line 12 in the function definition of
messageItem
, the following logicshiny::tagList(shiny::a(class = itemCl, id = inputId, href = if (is.null(inputId)) { "#" } else { href }, ...)
returns "#" even if
href
is supplied as input.If the behavior is correct, I suggest updating the function description to be more precise in what is required. Else, I believe what may have happened was a "!" was missed in the logic so that:
href = if (!is.null(inputId)) { "#" } else { href }
is the intended behavior. This would allow not having to create unused
inputId
variables.Thanks!
The text was updated successfully, but these errors were encountered: