{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/1315","repository_url":"https://api.github.com/repos/rstudio/shiny","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/1315/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/1315/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/1315/events","html_url":"https://github.com/rstudio/shiny/pull/1315","id":172803273,"number":1315,"title":"Fix updateDateRangeInput when only one of start/end updated","user":{"login":"gaborcsardi","id":660288,"avatar_url":"https://avatars.githubusercontent.com/u/660288?v=3","gravatar_id":"","url":"https://api.github.com/users/gaborcsardi","html_url":"https://github.com/gaborcsardi","followers_url":"https://api.github.com/users/gaborcsardi/followers","following_url":"https://api.github.com/users/gaborcsardi/following{/other_user}","gists_url":"https://api.github.com/users/gaborcsardi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborcsardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborcsardi/subscriptions","organizations_url":"https://api.github.com/users/gaborcsardi/orgs","repos_url":"https://api.github.com/users/gaborcsardi/repos","events_url":"https://api.github.com/users/gaborcsardi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborcsardi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-23T20:50:27Z","updated_at":"2016-08-23T21:28:39Z","closed_at":"2016-08-23T21:07:53Z","pull_request":{"url":"https://api.github.com/repos/rstudio/shiny/pulls/1315","html_url":"https://github.com/rstudio/shiny/pull/1315","diff_url":"https://github.com/rstudio/shiny/pull/1315.diff","patch_url":"https://github.com/rstudio/shiny/pull/1315.patch"},"body":"App to test:\r\n\r\n```r\r\nshinyApp(\r\n  ui = fluidPage(\r\n    div(\r\n      dateRangeInput(\"daterange\", \"Date range:\",\r\n                     start = \"2001-01-01\",\r\n                     end   = \"2010-12-31\")\r\n    ),\r\n    actionButton(\"btn1\", \"leave start & end alone\"),\r\n    actionButton(\"btn2\", \"set date range start\"),\r\n    actionButton(\"btn3\", \"set date range end\"),\r\n    actionButton(\"btn4\", \"set date range start and end\")\r\n  ),\r\n  server = function(input, output, session) {\r\n    observeEvent(input$btn1, updateDateRangeInput(session, \"daterange\"))\r\n    observeEvent(input$btn2, updateDateRangeInput(session, \"daterange\", start = \"2005-01-01\"))    \r\n    observeEvent(input$btn3, updateDateRangeInput(session, \"daterange\", end = \"2006-01-01\"))\r\n    observeEvent(input$btn4, updateDateRangeInput(session, \"daterange\", start = \"2007-01-01\", end = \"2008-01-01\"))\r\n  }\r\n)\r\n```"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/241885391","html_url":"https://github.com/rstudio/shiny/pull/1315#issuecomment-241885391","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/1315","id":241885391,"user":{"login":"gaborcsardi","id":660288,"avatar_url":"https://avatars.githubusercontent.com/u/660288?v=3","gravatar_id":"","url":"https://api.github.com/users/gaborcsardi","html_url":"https://github.com/gaborcsardi","followers_url":"https://api.github.com/users/gaborcsardi/followers","following_url":"https://api.github.com/users/gaborcsardi/following{/other_user}","gists_url":"https://api.github.com/users/gaborcsardi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborcsardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborcsardi/subscriptions","organizations_url":"https://api.github.com/users/gaborcsardi/orgs","repos_url":"https://api.github.com/users/gaborcsardi/repos","events_url":"https://api.github.com/users/gaborcsardi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborcsardi/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T21:28:39Z","updated_at":"2016-08-23T21:28:39Z","body":"It looks like the R `list(NULL, NULL)` is converted to `[null, null]` in JS, just like `list(NA, NA)`. \r\n:( This was not a problem before the other PR, because `null` values were ignored....\r\n\r\nE.g. see the first two buttons.\r\n\r\n```r\r\nshinyApp(\r\n  ui = fluidPage(\r\n    div(\r\n      dateRangeInput(\"daterange\", \"Date range:\",\r\n                     start = \"2001-01-01\",\r\n                     end   = \"2010-12-31\")\r\n    ),\r\n    actionButton(\"btn1\", \"leave start & end alone\"),\r\n    actionButton(\"btn11\", \"reset start & end with NA\"),\r\n    actionButton(\"btn2\", \"set date range start\"),\r\n    actionButton(\"btn3\", \"set date range end\"),\r\n    actionButton(\"btn4\", \"set date range start and end\")\r\n  ),\r\n  server = function(input, output, session) {\r\n    observeEvent(input$btn1, updateDateRangeInput(session, \"daterange\"))\r\n    observeEvent(input$btn11, updateDateRangeInput(session, \"daterange\", start = NA, end = NA))\r\n    observeEvent(input$btn2, updateDateRangeInput(session, \"daterange\", start = \"2005-01-01\"))    \r\n    observeEvent(input$btn3, updateDateRangeInput(session, \"daterange\", end = \"2006-01-01\"))\r\n    observeEvent(input$btn4, updateDateRangeInput(session, \"daterange\", start = \"2007-01-01\", end = \"2008-01-01\"))\r\n  }\r\n)\r\n```\r\n\r\nHow about passing a named list to JS? That should solve this I think."}}
{"actor":{"display_login":"gaborcsardi"}}