RinteRface / bs4Dash

Bootstrap 4 shinydashboard using AdminLTE3
https://bs4dash.rinterface.com
Other
441 stars 81 forks source link

Right control of carousel is broken #361

Open JsLth opened 1 year ago

JsLth commented 1 year ago

When clicking on the right arrow of a bs4Dash::carousel, the page jumps down, but the carousel is not triggered. The left arrow works as expected. You can view a live demonstration of this on the demo server.

I think the issue here is that for the right button, href and data-target are set incorrectly. From useful-items.R#L382, with added comments:

shiny::tagList(
  # previous
  shiny::tags$a(
    class = "carousel-control-prev",
   `data-target` = paste0("#", id),
    href = "#",
    role = "button",
    `data-slide` = "prev",
    shiny::tags$span(
      class = "carousel-control-prev-icon",
      `aria-hidden` = "true"
    ),
    shiny::tags$span(class = "sr-only", "Previous")
  ),
  # next
  shiny::tags$a(
    class = "carousel-control-next",
    # This is where `data-target` should be set
    # `data-target` = paste0("#", id),
    # href = "#",
    href = paste0("#", id), # this is the value that should be set for data-target
    role = "button",
    `data-slide` = "next",
    shiny::tags$span(
      class = "carousel-control-next-icon",
      `aria-hidden` = "true"
    ),
    shiny::tags$span(class = "sr-only", "Next")
  )
)