ramnathv / htmlwidgets

HTML Widgets for R
http://htmlwidgets.org
Other
792 stars 205 forks source link

Call "JS function" Incompatibility with other package (reactable) #477

Closed jhk0530 closed 1 year ago

jhk0530 commented 1 year ago

Hi, thanks for nice work.

I use this packag a lot, and really appreciate with it.

problem

However (2 days ago) updated version of htmlwidgets crashes with another my favorite package reactable (see issue)

I'm not sure the reason, but calling custom Javascript function doesn't work. (reactable didn't changed recently)

Below is minimal example code for trying. (the JS function worked in previous version, but not in 1.6.3)

library(reactable)

reactable(iris[1:5, ], 
    selection = "single", 
    onClick = JS("function(row, column, rowInfo) {
        console.log('asdf');
        row.toggleRowSelected();
      }")
)

If you have any idea, please let me know

Thanks.


Note

I downgraded htmlwidgets package's version into 1.6.2 with below code

remotes::install_version('htmlwidgets', version = '1.6.2', repos = "http://cran.us.r-project.org")
msaltieri commented 1 year ago

Same problem here!

gadenbuie commented 1 year ago

Thanks for the reports, and apologies for the inconvenience. I will look into this ASAP, but please keep in mind that it's a long holiday weekend in the United States.

In this case, it will be helpful for anyone experiencing this issue to include any additional reproducible examples where JS() calls aren't working as expected.

jhk0530 commented 1 year ago

Hi all, it seems using reactR and htmlwidgets with dev version (install with remotes::install_github) works fine with custom JS function

So I think this issue may close when update htmlwidgets package for CRAN.

Thanks.

cvaldezerea commented 11 months ago

This problem is not solved

gadenbuie commented 11 months ago

This problem is not solved

@cvaldezerea Could you clarify? Also note that the fixed version of htmlwidgets hasn't been released to CRAN yet. We're in the process of submitting the release now. If you've tested with the dev version of htmlwidgets and are still encountering issues, please let us know ASAP.

jhk0530 commented 11 months ago

Now, 1.6.4 version (which is available with CRAN install) of htmlwidgets solve this problem. @cvaldezerea