{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/1098","repository_url":"https://api.github.com/repos/rstudio/shiny","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/1098/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/1098/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/1098/events","html_url":"https://github.com/rstudio/shiny/issues/1098","id":131692115,"number":1098,"title":"Potential bug in data transport from JS to R using Shiny.onInputChange","user":{"login":"ramnathv","id":346288,"avatar_url":"https://avatars.githubusercontent.com/u/346288?v=3","gravatar_id":"","url":"https://api.github.com/users/ramnathv","html_url":"https://github.com/ramnathv","followers_url":"https://api.github.com/users/ramnathv/followers","following_url":"https://api.github.com/users/ramnathv/following{/other_user}","gists_url":"https://api.github.com/users/ramnathv/gists{/gist_id}","starred_url":"https://api.github.com/users/ramnathv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramnathv/subscriptions","organizations_url":"https://api.github.com/users/ramnathv/orgs","repos_url":"https://api.github.com/users/ramnathv/repos","events_url":"https://api.github.com/users/ramnathv/events{/privacy}","received_events_url":"https://api.github.com/users/ramnathv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-02-05T16:48:18Z","updated_at":"2016-07-27T18:28:06Z","closed_at":"2016-07-27T18:28:06Z","body":"Here is a repro case. I am trying to return an array of objects back to R, which I would have expected to be unpacked either to a list or a data frame. However, it seems to be getting unpacked to a vector. Am I doing something wrong, or is this behavior a bug?\r\n\r\n```r\r\nlibrary(shiny)\r\nui <- fluidPage(\r\n  p(\"Hello World\"),\r\n  textOutput(\"out\"),\r\n  tags$script(\"\r\n    var dat = 'hello'\r\n    $('p').on('click', function(){\r\n      console.log('Hello')\r\n      var d = [{x: 1, y: 2}, {x: 3, y: 4}]\r\n      //var d = {x: 1, y: 2}\r\n      Shiny.onInputChange('dat', d)\r\n    })            \r\n  \")\r\n)\r\n\r\nserver <- function(input, output, session){\r\n  output$out <- renderText({\r\n     if (!is.null(input$dat)){\r\n       print(input$dat)\r\n       print(str(input$dat))\r\n       capture.output(input$dat)\r\n     } else {\r\n       \"Click to Reveal\"\r\n     }\r\n  })\r\n}\r\n\r\nshinyApp(ui = ui, server = server)\r\n```"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/235676220","html_url":"https://github.com/rstudio/shiny/issues/1098#issuecomment-235676220","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/1098","id":235676220,"user":{"login":"wch","id":86978,"avatar_url":"https://avatars.githubusercontent.com/u/86978?v=3","gravatar_id":"","url":"https://api.github.com/users/wch","html_url":"https://github.com/wch","followers_url":"https://api.github.com/users/wch/followers","following_url":"https://api.github.com/users/wch/following{/other_user}","gists_url":"https://api.github.com/users/wch/gists{/gist_id}","starred_url":"https://api.github.com/users/wch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wch/subscriptions","organizations_url":"https://api.github.com/users/wch/orgs","repos_url":"https://api.github.com/users/wch/repos","events_url":"https://api.github.com/users/wch/events{/privacy}","received_events_url":"https://api.github.com/users/wch/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T18:28:06Z","updated_at":"2016-07-27T18:28:06Z","body":"I think my answer above and Joe's answer in #1247 address the issue."}}
{"actor":{"display_login":"wch"}}