-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
onRestored and selectizeInput #1767
Comments
I'm not able to reproduce the problem. Can you send the results of |
Listening on http://127.0.0.1:3456
SEND {"busy":"busy"}
SEND {"config":{"workerId":"","sessionId":"f0491cdd619a22788ffb49c1b4b053ba","user":null}}
RECV {"method":"init","data":{"add1:shiny.action":0,"._bookmark_:shiny.action":0,".clientdata_pixelratio":1,".clientdata_url_protocol":"http:",".clientdata_url_hostname":"127.0.0.1",".clientdata_url_port":"3456",".clientdata_url_pathname":"/",".clientdata_url_search":"",".clientdata_url_hash_initial":"",".clientdata_url_hash":"",".clientdata_singletons":"",".clientdata_allowDataUriScheme":true}}
SEND {"busy":"idle"}
SEND {"errors":[],"values":[],"inputMessages":[]}
SEND {"busy":"busy"}
SEND {"config":{"workerId":"","sessionId":"0367eeccac0e4136373f3ea4f049894e","user":null}}
RECV {"method":"init","data":{"add1:shiny.action":0,"._bookmark_:shiny.action":0,".clientdata_pixelratio":1,".clientdata_url_protocol":"http:",".clientdata_url_hostname":"127.0.0.1",".clientdata_url_port":"3456",".clientdata_url_pathname":"/",".clientdata_url_search":"?_values_&nItems=4",".clientdata_url_hash_initial":"",".clientdata_url_hash":"",".clientdata_singletons":"",".clientdata_allowDataUriScheme":true}}
SEND {"busy":"idle"}
SEND {"errors":[],"values":[],"inputMessages":[]}
SEND {"shiny-insert-ui":{"selector":"#empty","multiple":false,"where":"beforeEnd","content":{"html":"<div class=\"form-group shiny-input-container\">\n <label class=\"control-label\" for=\"select1\">Select 1<\/label>\n <div>\n <select id=\"select1\"><option value=\"a\" selected>a<\/option>\n<option value=\"b\">b<\/option>\n<option value=\"c\">c<\/option>\n<option value=\"d\">d<\/option>\n<option value=\"e\">e<\/option><\/select>\n <script type=\"application/json\" data-for=\"select1\" data-nonempty=\"\">{}<\/script>\n <\/div>\n<\/div>","deps":[{"name":"selectize","version":"0.11.2","src":{"href":"shared/selectize"},"meta":null,"script":null,"stylesheet":"css/selectize.bootstrap3.css","head":"<!--[if lt IE 9]>\n<script src=\"shared/selectize/js/es5-shim.min.js\"><\/script>\n<![endif]-->\n<script src=\"shared/selectize/js/selectize.min.js\"><\/script>","attachment":null,"package":null,"all_files":true}]}}}
SEND {"shiny-insert-ui":{"selector":"#empty","multiple":false,"where":"beforeEnd","content":{"html":"<div class=\"form-group shiny-input-container\">\n <label class=\"control-label\" for=\"select2\">Select 2<\/label>\n <div>\n <select id=\"select2\"><option value=\"a\" selected>a<\/option>\n<option value=\"b\">b<\/option>\n<option value=\"c\">c<\/option>\n<option value=\"d\">d<\/option>\n<option value=\"e\">e<\/option><\/select>\n <script type=\"application/json\" data-for=\"select2\" data-nonempty=\"\">{}<\/script>\n <\/div>\n<\/div>","deps":[{"name":"selectize","version":"0.11.2","src":{"href":"shared/selectize"},"meta":null,"script":null,"stylesheet":"css/selectize.bootstrap3.css","head":"<!--[if lt IE 9]>\n<script src=\"shared/selectize/js/es5-shim.min.js\"><\/script>\n<![endif]-->\n<script src=\"shared/selectize/js/selectize.min.js\"><\/script>","attachment":null,"package":null,"all_files":true}]}}}
SEND {"shiny-insert-ui":{"selector":"#empty","multiple":false,"where":"beforeEnd","content":{"html":"<div class=\"form-group shiny-input-container\">\n <label class=\"control-label\" for=\"select3\">Select 3<\/label>\n <div>\n <select id=\"select3\"><option value=\"a\" selected>a<\/option>\n<option value=\"b\">b<\/option>\n<option value=\"c\">c<\/option>\n<option value=\"d\">d<\/option>\n<option value=\"e\">e<\/option><\/select>\n <script type=\"application/json\" data-for=\"select3\" data-nonempty=\"\">{}<\/script>\n <\/div>\n<\/div>","deps":[{"name":"selectize","version":"0.11.2","src":{"href":"shared/selectize"},"meta":null,"script":null,"stylesheet":"css/selectize.bootstrap3.css","head":"<!--[if lt IE 9]>\n<script src=\"shared/selectize/js/es5-shim.min.js\"><\/script>\n<![endif]-->\n<script src=\"shared/selectize/js/selectize.min.js\"><\/script>","attachment":null,"package":null,"all_files":true}]}}}
SEND {"shiny-insert-ui":{"selector":"#empty","multiple":false,"where":"beforeEnd","content":{"html":"<div class=\"form-group shiny-input-container\">\n <label class=\"control-label\" for=\"select4\">Select 4<\/label>\n <div>\n <select id=\"select4\"><option value=\"a\" selected>a<\/option>\n<option value=\"b\">b<\/option>\n<option value=\"c\">c<\/option>\n<option value=\"d\">d<\/option>\n<option value=\"e\">e<\/option><\/select>\n <script type=\"application/json\" data-for=\"select4\" data-nonempty=\"\">{}<\/script>\n <\/div>\n<\/div>","deps":[{"name":"selectize","version":"0.11.2","src":{"href":"shared/selectize"},"meta":null,"script":null,"stylesheet":"css/selectize.bootstrap3.css","head":"<!--[if lt IE 9]>\n<script src=\"shared/selectize/js/es5-shim.min.js\"><\/script>\n<![endif]-->\n<script src=\"shared/selectize/js/selectize.min.js\"><\/script>","attachment":null,"package":null,"all_files":true}]}}}
RECV {"method":"update","data":{"select2":"a","select3":"a","select4":"a","select1":"a"}} |
I can't repro either and the stuff above all looks good. It seems like the problem must be a conflict with selectize. Are you able to get this behavior in another machine (virtual or otherwise)? |
I'm using Mozilla Firefox version 54. I tried the code on Google Chrome and Chromium, and the problem does not occur with these browsers! |
It seems like this used to be an issue for selectize + Firefox: selectize/selectize.js#198 It's weird it hasn't been fixed. |
I also noticed that the last line is different between Chrome and Firefox: ChromeRECV {"method":"update","data":{"select1":"a","select2":"a","select3":"a","select4":"a"}} FirefoxRECV {"method":"update","data":{"select2":"a","select3":"a","select4":"a","select1":"a"}} |
Here's a simpler reproducible example. Most of the time it looks correct in Firefox, but if I reload the page many times, it occasionally comes out in the wrong order, and some are not properly initialized as selectize inputs. library(shiny)
ui <- function(request) {
fluidPage(
div(id = "empty")
)
}
server <- shinyServer(function(input, output, session){
for (i in seq_len(4)){
insertUI("#empty",
ui = selectInput(paste0("select", i), label = paste("Select", i),
choices = letters[1:5]),
immediate = TRUE)
}
})
shinyApp(ui, server) |
Considering this code:
When I visit http://127.0.0.1:3456/?_values_&nItems=4, 2 problems occur with the selectInputs:
However when I add the
selectize = FALSE
argument, everything runs as expected.The text was updated successfully, but these errors were encountered: