title: R plotly `event_data` does not return `key` / `customdata` in a shiny app
body: <p>I want to filter a table and show only relevant data based on selection of points in a chart.
  I am trying to use <code>event_data</code> to filter the table using plotly and shiny.
  I copied this example from the official book <a href="https://plotly-r.com/linking-views-with-shiny.html#shiny-plotly-inputs" rel="nofollow noreferrer">link</a></p>
  <p>This does not render or show me the <code>customdata</code> on my pc, however it works on the link given in the book.
  <a href="https://testing-apps.shinyapps.io/plotlyevents/" rel="nofollow noreferrer">link to the shiny vis</a></p>
  <pre><code>library(shiny)
  library(plotly)
  
  ui &lt;- fluidPage(
    radioButtons(&quot;plotType&quot;, &quot;Plot Type:&quot;, choices = c(&quot;ggplotly&quot;, &quot;plotly&quot;)),
    plotlyOutput(&quot;plot&quot;),
    verbatimTextOutput(&quot;hover&quot;),
    verbatimTextOutput(&quot;click&quot;),
    verbatimTextOutput(&quot;brushing&quot;),
    verbatimTextOutput(&quot;selecting&quot;),
    verbatimTextOutput(&quot;brushed&quot;),
    verbatimTextOutput(&quot;selected&quot;)
  )
  
  server &lt;- function(input, output) {
    
    nms &lt;- row.names(mtcars)
    
    output$plot &lt;- renderPlotly({
      p &lt;- if (identical(input$plotType, &quot;ggplotly&quot;)) {
        ggplotly(ggplot(mtcars, aes(x = mpg, y = wt, customdata = nms)) + geom_point())
      } else {
        plot_ly(mtcars, x = ~mpg, y = ~wt, customdata = nms)
      }
      p %&gt;% 
        layout(dragmode = &quot;select&quot;) %&gt;%
        event_register(&quot;plotly_selecting&quot;)
    })
    
    output$hover &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_hover&quot;)
      if (is.null(d)) &quot;Hover events appear here (unhover to clear)&quot; else d
    })
    
    output$click &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_click&quot;)
      if (is.null(d)) &quot;Click events appear here (double-click to clear)&quot; else d
    })
    
    output$brushing &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_brushing&quot;)
      if (is.null(d)) &quot;Brush extents appear here (double-click to clear)&quot; else d
    })
    
    output$selecting &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_selecting&quot;)
      if (is.null(d)) &quot;Brush points appear here (double-click to clear)&quot; else d
    })
    
    output$brushed &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_brushed&quot;)
      if (is.null(d)) &quot;Brush extents appear here (double-click to clear)&quot; else d
    })
    
    output$selected &lt;- renderPrint({
      d &lt;- event_data(&quot;plotly_selected&quot;)
      if (is.null(d)) &quot;Brushed points appear here (double-click to clear)&quot; else d
    })
    
  }
  
  shinyApp(ui, server)
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/39BzP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/39BzP.png" alt="This is how it looks on my computer" /></a></p>
  <p><a href="https://i.stack.imgur.com/DxreA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DxreA.png" alt="This is how it looks in the documentation" /></a></p>
  <p>I am not sure what is wrong with my instance of R. Given below is my session info. Any advise on what could be the problem ?</p>
  <pre class="lang-r prettyprint-override"><code>sessionInfo()
  R version 4.0.2 (2020-06-22)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows 10 x64 (build 18363)
  
  Matrix products: default
  
  Random number generation:
   RNG:     Mersenne-Twister 
   Normal:  Inversion 
   Sample:  Rounding 
   
  locale:
  [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
  [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
  [5] LC_TIME=English_United States.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] reprex_0.3.0  shiny_1.6.0   plotly_4.9.3  ggplot2_3.3.3
  
  loaded via a namespace (and not attached):
   [1] tinytex_0.26      tidyselect_1.1.0  xfun_0.22         bslib_0.2.4       purrr_0.3.4      
   [6] colorspace_1.4-1  vctrs_0.3.6       generics_0.1.0    htmltools_0.5.1.1 viridisLite_0.3.0
  [11] yaml_2.2.1        rlang_0.4.10      pillar_1.4.7      later_1.1.0.1     jquerylib_0.1.3  
  [16] glue_1.4.2        withr_2.4.1       DBI_1.1.1         lifecycle_1.0.0   munsell_0.5.0    
  [21] gtable_0.3.0      htmlwidgets_1.5.3 evaluate_0.14     labeling_0.4.2    knitr_1.31       
  [26] callr_3.5.1       fastmap_1.0.1     ps_1.3.4          httpuv_1.5.4      crosstalk_1.1.1  
  [31] Rcpp_1.0.5        clipr_0.7.0       xtable_1.8-4      scales_1.1.1      promises_1.1.1   
  [36] DT_0.17           cachem_1.0.4      jsonlite_1.7.1    fs_1.5.0          mime_0.9         
  [41] digest_0.6.25     processx_3.4.4    dplyr_1.0.3       grid_4.0.2        cli_2.3.0        
  [46] tools_4.0.2       magrittr_2.0.1    sass_0.3.1        lazyeval_0.2.2    tibble_3.0.3     
  [51] whisker_0.4       crayon_1.4.1      tidyr_1.1.2       pkgconfig_2.0.3   ellipsis_0.3.1   
  [56] rsconnect_0.8.17  data.table_1.13.0 assertthat_0.2.1  rmarkdown_2.7     httr_1.4.2       
  [61] R6_2.5.0          compiler_4.0.2  
  </code></pre>
  <p><sup>Created on 2021-04-12 by the <a href="https://reprex.tidyverse.org" rel="nofollow noreferrer">reprex package</a> (v0.3.0)</sup></p>