Skip to content
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

event handling #14

Closed
timelyportfolio opened this issue Feb 3, 2019 · 1 comment
Closed

event handling #14

timelyportfolio opened this issue Feb 3, 2019 · 1 comment

Comments

@timelyportfolio
Copy link
Collaborator

timelyportfolio commented Feb 3, 2019

Currently, there is no way to pass events from a react htmlwidget to Shiny. We have very briefly discussed the following approaches. I'd like to target this for next release.

Prop

One approach (shown in pull) would be to use a special prop that would get evaluated in react-tools.js. This is easy but only allows a single event, could interfere with a real prop (unlikely but possible), and requires a one argument function.

Wrapper Function in R

Another approach would add a function in R, such as withShinyEvent( reactwidget, ... ), that attaches an event handler to a widget.

Custom JavaScript from Author

@pvictor demonstrates how a widget author might write a custom component in JavaScript in reactcolors. This provides fairly unlimited flexibility but requires a higher level of author skill.

Are there other approaches not considered?

@timelyportfolio
Copy link
Collaborator Author

should be solved by #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant