-
Notifications
You must be signed in to change notification settings - Fork 4
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
Error in browser console when using the grid parameter #23
Comments
PS: it seems this error appears again every time the browser window is resized. |
Chrome gives:
|
Maybe this is related to the latest changes in shiny described here? |
@gadenbuie do you think the above could be caused by shiny's new asynchronous rendering? |
Yeah, I saw this error with Chrome. The file |
The errors remain after installing shiny's latest dev version. |
Hi all! I tested the example app in this thread with an older version of Shiny (1.7.4) that predates the async changes and the error is still present. This means it's unlikely to be due to a recent shiny-specific change. I poked around a little bit but didn't see anything immediately obvious as to the source of the error. I can say that when the browser window is resized, htmlwidgets that are shiny outputs will attempt to call the In the case of jstreer, where there is no resize logic or desire to resize the component, these warnings are harmless and can probably be ignored. |
@gadenbuie thanks for looking into this and sharing your insights! Good to know that you consider the error uncritical. @stla I just realized that these errors seem to be related to the grid table Once we use |
@stla I just saw another error, which fires only once on startup (not after every window resize): The browser points at: |
Thanks. That should be fixed now. Strange that we didn't see this problem earlier. |
The resize method in jstreer.js currently is empty. |
I'm having the same issue and to me it seems under certain circumstances this can impact other widgets. Unfortunately, so far I wasn't able to condense this into a reprex (only happens with my bigger app). @stla or @gadenbuie is there any minimal Thanks in advance! |
Perhaps it would be possible for shiny to check if the method exists before calling it, to prevent the error: using something like this:
However, I still don't understand why this is happening only when using the grid plugin. Maybe something is overwritten? |
@ismirsehregal Are you sure? The error is:
So that means that |
Hi Stéphane, Here I read:
..and thought maybe that is the case. However, my JS knowledge is quite limited.. so I could very well be wrong. So maybe shiny needs to check for |
Yes, the grid has the class $(".shiny-bound-output") It is the element <div class="jstree-grid-wrapper jstreer html-widget html-widget-output shiny-report-size html-fill-item shiny-bound-output" style="width: 600px;">......</div> But this element has no attached Maybe we should remove the $(".jstree-grid-wrapper").removeClass("shiny-bound-output") What do you think, @gadenbuie ? |
@stla thanks for looking into this! I can confirm, that once I remove the class "shiny-bound-output" from the "jstree-grid-wrapper" div (via the browser) the plotly charts in my app are again resized. It would be great if this could somehow be incorporated into {jsTreeR}. |
I think the question is: what is a clean way to do so? Is simply removing the class "shiny-bound-output" appropriate? I have no experience in building custom outputs but I guess the issue could be, that the grid is a parent div of the tree but the tree was defined as the output? What is shiny expecting from the data attribute? |
I've done a change: I included the class removal in the remotes::install_github("stla/jsTreeR@unbind_grid") |
@stla this version works fine - thank you! So far I haven't encountered any unwanted side-effects. |
I raised another issue here hoping for clarification. |
Stéphane's explanation on the root cause can be found here. Thanks for this! |
Fixed via d199614 |
Running the below app using the latest jsTreeR dev version and the latest shiny cran version gives me:
The text was updated successfully, but these errors were encountered: