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

Server-side updateSelectizeInput Fails for Internet Exporer and Edge Browsers #1257

Closed
DarioS opened this issue Jul 24, 2016 · 9 comments
Closed
Assignees

Comments

@DarioS
Copy link

DarioS commented Jul 24, 2016

When updateSelectizeInput is used to change the list of choices, it doesn't work if I use Microsoft-developed browsers. The same Shiny application works in Opera 38, for example. It also works in the Microsoft=developed browsers if server is set to FALSE.

server = shinyServer(function(input, output, session) {

  observeEvent(input[["dataChoice"]],
               {
                 options <- switch(input[["dataChoice"]], Letters = LETTERS[1:5], Numbers = 1:5)
                 updateSelectizeInput(session, "itemChoice", choices = options, server = TRUE)
               })
})

interface = fluidPage(
  selectizeInput("dataChoice", "Choose Data Type", c("Letters", "Numbers")),
  selectizeInput("itemChoice", "Choose An Item", "")
)

shinyApp(server = server, ui = interface)

Will the cross-browser compatibility of Shiny be improved?

@gtumuluri
Copy link

I am having the exact same issue. Here is my reproducible code. Works fine on Chrome. IE11 is standard browser across my Enterprise, and my app does not work for any of my users. Appreciate any workaround or fix.

# mylist
selectList1 <- sapply(1:15000, function(x) paste0(x, "_", paste(sample(LETTERS, 10), collapse = '')))
selectList2 <- sapply(1:15000, function(x) paste0(x, "_", paste(sample(letters, 10), collapse = '')))

# ui
ui <- fluidPage(
  selectizeInput(
    inputId = 'mylist', label = 'Select Something',
    choices = NULL,
    selected = 1
  ),
  radioButtons('letterType',
               'Select a Letter Type:',
               choices = c('Upper Case' = 'upper',
                           'Lower Case' = 'lower'),
               selected = 'upper',
               inline = TRUE)
)

# server
server <- function(input, output, session) {
  selectListReactive <- reactive({
    validate(need(!is.null(input$letterType), ''))
    if (input$letterType == 'upper')
      selectList1
    else
      selectList2
  })
  observeEvent(input$letterType, {
    updateSelectizeInput(session = session, inputId = 'mylist',
                         choices = c(Choose = '', selectListReactive()),
                         server = TRUE)
  })
}

# app
shinyApp(ui = ui, server = server)

@bborgesr bborgesr added P2 bug and removed P3 bug labels Aug 4, 2016
@jcheng5
Copy link
Member

jcheng5 commented Aug 4, 2016

Does this occur with the latest CRAN version of Shiny?

@gopalatumuluri
Copy link

Yes, I just installed it from CRAN and it is reproducible. The drop down list just does not change. Sticks with the original selection list (upper case in this case).

packageVersion('shiny')
[1] ‘0.13.2’

version
               _                                          
platform       x86_64-w64-mingw32                         
arch           x86_64                                     
os             mingw32                                    
system         x86_64, mingw32                            
status         Revised                                    
major          3                                          
minor          2.4                                        
year           2016                                       
month          03                                         
day            16                                         
svn rev        70336                                      
language       R                                          
version.string R version 3.2.4 Revised (2016-03-16 r70336)
nickname       Very Secure Dishes 

@jcheng5 jcheng5 added P1 bug and removed P2 bug labels Aug 5, 2016
@bborgesr bborgesr self-assigned this Aug 5, 2016
@bborgesr
Copy link
Contributor

bborgesr commented Aug 5, 2016

Some notes:

Here's the smallest chunk of code that produces this problem:

library(shiny)

ui <- fluidPage(selectInput('mylist', 'Select Something', choices = NULL))

server <- function(input, output, session) {
  updateSelectInput(session, 'mylist', choices = c("a", "b", "c"))
}

shinyApp(ui = ui, server = server)

The choices are never updated -- the problem is with updateSelectInput

@bborgesr
Copy link
Contributor

bborgesr commented Aug 8, 2016

I think we should move the priority down on this bug. I'm still working on trying to fix it, but this does not occur for the latest version of IE11.

This produces the bug:
screen shot 2016-08-08 at 4 56 28 pm

This doesn't:
screen shot 2016-08-08 at 5 38 41 pm

After discovering this, I looked into selectize's own demos in these two IE versions and they have exactly the same problem. So unfortunately, the sad conclusion is that there is nothing we can do about this for shiny because the problem is entirely with selectize. We could try to figure out a patch and submit a PR to selectize but that really doesn't seem worth it for something that is fixed in the latest version of IE (the problem with that is that I think this is not available for Windows 8 machines) -- Microsoft is killing me here...

@jcheng5, @wch, what do we do here? We could drop this since it clearly is a bug in IE that has been fixed in the latest version. Or we could try to create some work around that does not use selectize for the cases in which it crashes. But this would be ugly, ugly, ugly... Open to suggestions...

@gopalatumuluri
Copy link

I should have also reported the IE version. Sorry about that. Here is the version our corporate client is using. So, it does seem to fall in the 'problem release.'

screen shot 2016-08-08 at 2 03 13 pm

@bborgesr
Copy link
Contributor

bborgesr commented Aug 8, 2016

@gopalatumuluri, thanks for the info. The situation actually looks less dire than I previously thought. If all goes well, we should have a fix in master by the end of the day. Fingers crossed!

@DarioS
Copy link
Author

DarioS commented Aug 9, 2016

I wish Internet Explorer didn't use so many digits in its version ID.

I'd suggest that Barbara submit a bug report to selectize.js. It probably won't be fixed for a year, but it's better than not being ever handled.

@bborgesr
Copy link
Contributor

bborgesr commented Aug 9, 2016

This should be fixed now. Let me know if either of you still encounter any problems.

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

No branches or pull requests

5 participants