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

getContainerRenderWindow in Saturation component inside iframe is causing a crash #806

Open
yarindeohcld opened this issue Feb 21, 2021 · 6 comments

Comments

@yarindeohcld
Copy link

yarindeohcld commented Feb 21, 2021

I'm rendering a custom picker inside an iframe that is using Saturation common component.
I'm receiving a CORS origin error that caused by the following code:

image

getContainerRenderWindow

      var container = this.container;

      var renderWindow = window;
      while (!renderWindow.document.contains(container) && renderWindow.parent !== renderWindow) {
        renderWindow = renderWindow.parent;
      }
      return renderWindow;
    }

after evaluating renderWindow = renderWindow.parent, there's no document to access and it caused the failures. What is the propose behind that ?

a local fix was to override this method and return always window.

any insights ? it need to be used in prod

@yarindeohcld yarindeohcld changed the title getContainerRenderWindow in Saturation component inside iframe getContainerRenderWindow in Saturation component inside iframe is causing a crash Feb 21, 2021
@woowalker
Copy link

same problem, still finding solution

@hustcc
Copy link

hustcc commented May 25, 2021

Request to revert this PR #690

@hengwangm
Copy link

image
There is no document here!

tconkling added a commit to streamlit/streamlit that referenced this issue Jul 6, 2021
On Streamlit Sharing, ColorPicker throws a cross-origin error when its popover window is closed. There's an issue open in the react-color repo (casesandberg/react-color#806) - but it's months old and hasn't had a developer response.

With this PR, we now swallow all SecurityErrors thrown within `<ColorPicker>`. ColorPicker's functionality remains intact.

Here's a sample app running on Sharing with this frontend fix: https://share.streamlit.io/tconkling/st_colorpicker_test/main/app.py

Fixes #2689
@woowalker
Copy link

still 2.19.3

@nuthinking
Copy link

Having this issue too and my panel is not even display the Saturation option!

@nuthinking
Copy link

Fix is here: uiwjs/react-color#81 (comment)

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

No branches or pull requests

5 participants