Created
July 18, 2019 11:53
-
-
Save ColinFay/a144b1c0fdf386b914e83fe04155a143 to your computer and use it in GitHub Desktop.
Demo of event from right click in shiny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
ui <- function(request){ | |
tagList( | |
tags$script( | |
"$(function(){ | |
$(this).bind('contextmenu', function (e) { | |
e.preventDefault() | |
Shiny.setInputValue('plop', Math.random()); | |
}); | |
});" | |
) | |
) | |
} | |
server <- function(input, output, session){ | |
observeEvent( input$plop , { | |
print(input$plop) | |
}) | |
} | |
shinyApp(ui, server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment