Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right control of carousel is broken #361

Open
JsLth opened this issue Sep 11, 2023 · 0 comments
Open

Right control of carousel is broken #361

JsLth opened this issue Sep 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@JsLth
Copy link

JsLth commented Sep 11, 2023

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")
  )
)
@DivadNojnarg DivadNojnarg added the bug Something isn't working label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants