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

jqui_sortable order overwritten by selectizeInput drag and drop #83

Closed
gacolitti opened this issue Dec 28, 2021 · 1 comment
Closed
Labels

Comments

@gacolitti
Copy link

The order inside jqui_sortable() is lost when dragging and dropping choices for selectizeInput().

Here is a reproducible example:

library(shiny)
library(shinyjqui)

ui <- fluidPage(
      jqui_sortable(
        div(id = "lst",
        selectizeInput("c", "Select", c("a", "b"),
                       multiple = TRUE,
                       options = list(plugins = list('drag_drop')))
      )
  ),
  br(),
  br(),
  br(),
  verbatimTextOutput("lst_order")
)

server <- function(input, output, session) {
  
  output$lst_order <- renderPrint({
    str(input$lst_order$id)
  })
  
}

shinyApp(ui, server)

CleanShot 2021-12-28 at 15 09 47

What is causing this? Is there any way to avoid this behavior?

@Yang-Tang Yang-Tang added the bug label Dec 29, 2021
@Yang-Tang
Copy link
Owner

This is a bug. The drag_drop plugin of selectizeInput() is also based on jquery-ui. When you do the drag and drop inside the selectizeInput, it will trigger the same js event that causes jqui_sortable to react on it. It has been fixed now with 78a54b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants